all: simplify and fix database iteration with prefix/start (#20808)
* core/state/snapshot: start fixing disk iterator seek * ethdb, rawdb, leveldb, memorydb: implement iterators with prefix and start * les, core/state/snapshot: iterator fixes * all: remove two iterator methods * all: rename Iteratee.NewIteratorWith -> NewIterator * ethdb: fix review concerns
This commit is contained in:
committed by
GitHub
parent
00064ddcfb
commit
6402c42b67
@ -145,3 +145,14 @@ func TrimLeftZeroes(s []byte) []byte {
|
||||
}
|
||||
return s[idx:]
|
||||
}
|
||||
|
||||
// TrimRightZeroes returns a subslice of s without trailing zeroes
|
||||
func TrimRightZeroes(s []byte) []byte {
|
||||
idx := len(s)
|
||||
for ; idx > 0; idx-- {
|
||||
if s[idx-1] != 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return s[:idx]
|
||||
}
|
||||
|
Reference in New Issue
Block a user