File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,17 +190,17 @@ StatusOr<std::vector<int>> CommandTable::GetKeysFromCommand(const CommandAttribu
190190 return {Status::NotOK, " Invalid syntax found in this command arguments: " + s.Msg ()};
191191 }
192192
193- bool has_key_args = true ;
193+ Status status ;
194194 std::vector<int > key_indexes;
195195
196196 attributes->ForEachKeyRange (
197- [&key_indexes, &cmd_tokens ](const std::vector<std::string> &, CommandKeyRange key_range) {
198- key_range.ForEachKeyIndex ([&key_indexes ](int i) { key_indexes.push_back (i); }, cmd_tokens.size ());
197+ [&](const std::vector<std::string> &, CommandKeyRange key_range) {
198+ key_range.ForEachKeyIndex ([&](int i) { key_indexes.push_back (i); }, cmd_tokens.size ());
199199 },
200- cmd_tokens, [&has_key_args ](const auto &) { has_key_args = false ; });
200+ cmd_tokens, [&](const auto &) { status = {Status::NotOK, " The command has no key arguments " } ; });
201201
202- if (!has_key_args ) {
203- return {Status::NotOK, " The command has no key arguments " } ;
202+ if (!status ) {
203+ return status ;
204204 }
205205
206206 return key_indexes;
You can’t perform that action at this time.
0 commit comments