src: Use pre-increment iterator syntax
Cppcheck produces the following warning: ``` string_utils.cc:24:9: performance: Prefer prefix ++/-- operators for non-primitive types. ``` Fixes #4340
This commit is contained in:
parent
aff303190d
commit
367879ddcf
|
@ -21,7 +21,7 @@ String trim_indent(StringView str)
|
||||||
|
|
||||||
utf8::iterator it{str.begin(), str};
|
utf8::iterator it{str.begin(), str};
|
||||||
while (it != str.end() and is_horizontal_blank(*it))
|
while (it != str.end() and is_horizontal_blank(*it))
|
||||||
it++;
|
++it;
|
||||||
|
|
||||||
const StringView indent{str.begin(), it.base()};
|
const StringView indent{str.begin(), it.base()};
|
||||||
return accumulate(str | split_after<StringView>('\n') | transform([&](auto&& line) {
|
return accumulate(str | split_after<StringView>('\n') | transform([&](auto&& line) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user