Fix zero length declaration in rocksdbkv (#14576)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/14633/head
congqixia 2021-12-30 19:13:28 +08:00 committed by GitHub
parent 9e036af714
commit 07cf4f9ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -118,8 +118,8 @@ func (kv *RocksdbKV) LoadWithPrefix(prefix string) ([]string, []string, error) {
defer option.Destroy()
iter := kv.DB.NewIterator(option)
defer iter.Close()
keys := make([]string, 0)
values := make([]string, 0)
var keys, values []string
iter.Seek([]byte(prefix))
for ; iter.ValidForPrefix([]byte(prefix)); iter.Next() {
key := iter.Key()