]> source.dussan.org Git - rspamd.git/commitdiff
rspamc: optimize indentation condition 4381/head
authorAmish <3330468+amishmm@users.noreply.github.com>
Tue, 24 Jan 2023 05:57:41 +0000 (11:27 +0530)
committerAmish <3330468+amishmm@users.noreply.github.com>
Tue, 24 Jan 2023 05:57:41 +0000 (11:27 +0530)
src/client/rspamc.cxx

index a2d11fc13b69ba40bab2671a1a167d1f5e681920..fc1ba0cc1a8bcb424e5f042bbd441ea53cfd5c47 100644 (file)
@@ -840,8 +840,7 @@ rspamc_print_indented_line(FILE *out, std::string_view line) -> void
        for (size_t pos = 0; pos < line.size(); ) {
                auto len = pos ? (maxlen-indent) : maxlen;
                auto s = line.substr(pos, len);
-               if (s.size() == len && // is string long enough?
-                       (pos + s.size()) < line.size() && // reached EOL?
+               if ((pos + s.size()) < line.size() && // reached EOL?
                        break_begin.find_first_of( line.at(pos + s.size())) == std::string_view::npos // new word next?
                        ) {
                        auto wrap_at = s.find_last_of(break_end);