Skip to content

Commit

Permalink
fix format error
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahashen committed Apr 9, 2024
1 parent d41c7bb commit 259fc66
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cmd_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,23 +332,23 @@ bool SScanCmd::DoInitial(PClient* client) {
void SScanCmd::DoCmd(PClient* client) {
const auto& argv = client->argv_;
// parse arguments
int64_t cursor=0;
int64_t count=10;
int64_t cursor = 0;
int64_t count = 10;
std::string pattern{"*"};
if (pstd::String2int(argv[2], &cursor) == 0) {
client->SetRes(CmdRes::kInvalidCursor,kCmdNameSScan);
client->SetRes(CmdRes::kInvalidCursor, kCmdNameSScan);
return;
}
for (size_t i = 3; i < argv.size(); i += 2) {
if (auto lower = pstd::StringToLower(argv[i]); kMatchSymbol == lower) {
pattern = argv[i + 1];
} else if (kCountSymbol == lower) {
if (pstd::String2int(argv[i + 1], &count) == 0 ) {
if (pstd::String2int(argv[i + 1], &count) == 0) {
client->SetRes(CmdRes::kInvalidInt, kCmdNameSScan);
return;
}
if (count<0){
client->SetRes(CmdRes::kSyntaxErr,kCmdNameSScan);
if (count < 0){
client->SetRes(CmdRes::kSyntaxErr, kCmdNameSScan);
return;
}
} else {
Expand Down

0 comments on commit 259fc66

Please sign in to comment.