Skip to content

Commit d4269dd

Browse files
Update checkstl.cpp
1 parent 0ec9223 commit d4269dd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/checkstl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,6 +1978,7 @@ static bool isc_strConcat(const Token* tok)
19781978
if (!Token::Match(dot->astOperand2(), "c_str|data ( )"))
19791979
continue;
19801980
cstr = op;
1981+
break;
19811982
}
19821983
if (!cstr)
19831984
return false;
@@ -2100,7 +2101,7 @@ void CheckStl::string_c_str()
21002101
tok->variable() && (tok->variable()->isStlStringType() || tok->variable()->isStlStringViewType()) &&
21012102
tok->tokAt(2)->variable() && tok->tokAt(2)->variable()->isStlStringType()) {
21022103
string_c_strConstructor(tok, tok->variable()->getTypeName());
2103-
else if (printPerformance && isc_strConcat(tok)) {
2104+
} else if (printPerformance && isc_strConcat(tok)) {
21042105
string_c_strConcat(tok);
21052106
} else if (printPerformance && Token::simpleMatch(tok, "<<") && tok->astOperand2() && Token::Match(tok->astOperand2()->astOperand1(), ". c_str|data ( )")) {
21062107
const Token* str = tok->astOperand2()->astOperand1()->astOperand1();

0 commit comments

Comments
 (0)