diff --git a/src/query/command3.cpp b/src/query/command3.cpp index 055be17..328e22e 100644 --- a/src/query/command3.cpp +++ b/src/query/command3.cpp @@ -25,8 +25,9 @@ bool command_parser::parse(bool command) { while(index < this->data.size()) { findex = this->data.find('|', index); - if(findex == std::string::npos) + if(findex == std::string::npos) { findex = this->data.size(); + } this->_bulks.emplace_back(this->_bulks.size() - 1, index, this->data.substr(index, findex - index)); index = findex + 1; @@ -35,8 +36,9 @@ bool command_parser::parse(bool command) { } std::string_view command_parser::payload_view(size_t bulk_index) const noexcept { - if(bulk_index >= this->bulk_count()) + if(bulk_index >= this->bulk_count()) { return {}; + } auto bulk = this->bulk(bulk_index); return this->data.substr(bulk.command_character_index()); @@ -50,8 +52,10 @@ std::optional command_parser::next_bulk_containing(const std::string_vie if(next == std::string::npos) return std::nullopt; size_t upper_bulk{start + 1}; - for(; upper_bulk < this->bulk_count(); upper_bulk++) - if(this->bulk(upper_bulk).command_character_index() > next) + for(; upper_bulk < this->bulk_count(); upper_bulk++) { + if(this->bulk(upper_bulk).command_character_index() > next) { break; + } + } return upper_bulk - 1; } \ No newline at end of file