mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-02-23 12:36:45 +00:00
remove useless code
This commit is contained in:
parent
4f53e59af7
commit
a32dad8373
@ -466,45 +466,3 @@ func utilCosmosDemonGasPriceToEvmDemonGasPrice(gasGroup sdk.Coins) (*big.Int, er
|
|||||||
func utilCosmosDemonGasLimitToEvmDemonGasLimit(gasLimit uint64) uint64 {
|
func utilCosmosDemonGasLimitToEvmDemonGasLimit(gasLimit uint64) uint64 {
|
||||||
return gasLimit * chaincfg.GasDenomConversionMultiplier
|
return gasLimit * chaincfg.GasDenomConversionMultiplier
|
||||||
}
|
}
|
||||||
|
|
||||||
func findFirstContinuousDecreasingSubsequence(data []*txnInfo) int {
|
|
||||||
ll := len(data)
|
|
||||||
if ll < 2 {
|
|
||||||
return ll
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < ll-1; i++ {
|
|
||||||
if data[i].gasPrice.Cmp(data[i+1].gasPrice) >= 0 {
|
|
||||||
end := i + 1
|
|
||||||
for ; end < ll && data[end-1].gasPrice.Cmp(data[end].gasPrice) > 0; end++ {
|
|
||||||
}
|
|
||||||
if end == ll || data[end-1].gasPrice.Cmp(data[end].gasPrice) <= 0 {
|
|
||||||
return end
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return i + 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ll
|
|
||||||
}
|
|
||||||
|
|
||||||
func mergeSort(size int, left, right []*txnInfo) []*txnInfo {
|
|
||||||
result := make([]*txnInfo, 0, size)
|
|
||||||
i, j := 0, 0
|
|
||||||
|
|
||||||
for i < len(left) && j < len(right) {
|
|
||||||
if left[i].gasPrice.Cmp(right[j].gasPrice) > 0 {
|
|
||||||
result = append(result, left[i])
|
|
||||||
i++
|
|
||||||
} else {
|
|
||||||
result = append(result, right[j])
|
|
||||||
j++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result = append(result, left[i:]...)
|
|
||||||
result = append(result, right[j:]...)
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user