mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-10 22:10:11 +00:00
checkKeyCondition -> IsKeyInDomain
This commit is contained in:
@@ -247,7 +247,7 @@ func list(dirPath string, start, end []byte) ([]string, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to unescape %s while listing", name)
|
||||
}
|
||||
if checkKeyCondition(n, start, end) {
|
||||
if IsKeyInDomain(n, start, end) {
|
||||
paths = append(paths, n)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ func (db *MemDB) ReverseIterator(start, end []byte) Iterator {
|
||||
func (db *MemDB) getSortedKeys(start, end []byte) []string {
|
||||
keys := []string{}
|
||||
for key, _ := range db.db {
|
||||
if checkKeyCondition(key, start, end) {
|
||||
if IsKeyInDomain(key, start, end) {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func cpIncr(bz []byte) (ret []byte) {
|
||||
return EndingKey()
|
||||
}
|
||||
|
||||
func checkKeyCondition(key string, start, end []byte) bool {
|
||||
func IsKeyInDomain(key string, start, end []byte) bool {
|
||||
leftCondition := bytes.Equal(start, BeginningKey()) || strings.Compare(key, string(start)) >= 0
|
||||
rightCondition := bytes.Equal(end, EndingKey()) || strings.Compare(key, string(end)) < 0
|
||||
return leftCondition && rightCondition
|
||||
|
||||
Reference in New Issue
Block a user