commit 07b1b57: rspamc: optimize indentation condition

Amish 3330468+amishmm at users.noreply.github.com
Tue Jan 24 19:49:03 UTC 2023


Author: Amish
Date: 2023-01-24 11:27:41 +0530
URL: https://github.com/rspamd/rspamd/commit/07b1b57c88772904d45ccadf4fc34eaa491b6ba7 (refs/pull/4381/head)

rspamc: optimize indentation condition

---
 src/client/rspamc.cxx | 3 +--
 1 file changed, 1 insertion(+), 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);


More information about the Commits mailing list