Skip to content

Commit

Permalink
fix: fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Mar 18, 2024
1 parent 6fb14f7 commit bf80228
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/legacy/api/DatabaseAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ Local<Value> KVDBClass::listKey(const Arguments& args) {
try {
if (!isValid()) return Local<Value>();

auto list = kvdb->getAllKeys();
Local<Array> arr = Array::newArray();
for (auto& key : list) {
arr.add(String::newString(key));
}
return arr;
Local<Array> array = Array::newArray();
kvdb->iter([&array](std::string_view key, std::string_view value) {
array.add(String::newString(key));
return true;
});
return array;
}
CATCH_AND_THROW("Fail in DbListKey!");
}
Expand Down

0 comments on commit bf80228

Please sign in to comment.