summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-01-24 19:46:22 +0000
committerGitHub <noreply@github.com>2023-01-24 19:46:22 +0000
commit5da9cdea9b2dc8f6947e1a32ac79252b8e724800 (patch)
tree61647246726bf1c8734412cfb215fb9f3a8c02e8
parentc2f01dc0af36186a5185e2be310c655ad9277477 (diff)
parent07b1b57c88772904d45ccadf4fc34eaa491b6ba7 (diff)
downloadrspamd-5da9cdea9b2dc8f6947e1a32ac79252b8e724800.tar.gz
rspamd-5da9cdea9b2dc8f6947e1a32ac79252b8e724800.zip
Merge pull request #4381 from amishmm/wrap
[Minor] rspamc: optimize indentation condition
-rw-r--r--src/client/rspamc.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx
index a2d11fc13..fc1ba0cc1 100644
--- a/src/client/rspamc.cxx
+++ b/src/client/rspamc.cxx
@@ -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);