torwig commented on code in PR #2053:
URL: https://github.com/apache/kvrocks/pull/2053#discussion_r1466577810
##########
src/commands/cmd_hash.cc:
##########
@@ -372,7 +372,13 @@ class CommandHScan : public CommandSubkeyScanBase {
return {Status::RedisExecErr, s.ToString()};
}
- *output = GenerateOutput(srv, conn, fields, values, CursorType::kTypeHash);
+ auto cursor = GetNextCursor(srv, fields, CursorType::kTypeHash);
+ std::vector<std::string> entries;
Review Comment:
Can we utilize the `entries.reserve()` call here?
##########
src/commands/cmd_zset.cc:
##########
@@ -1350,12 +1351,13 @@ class CommandZScan : public CommandSubkeyScanBase {
return {Status::RedisExecErr, s.ToString()};
}
- std::vector<std::string> score_strings;
- score_strings.reserve(scores.size());
- for (const auto &score : scores) {
- score_strings.emplace_back(util::Float2String(score));
+ auto cursor = GetNextCursor(srv, members, CursorType::kTypeHash);
+ std::vector<std::string> entries;
Review Comment:
And `reserve` here as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]