code cleanup for invertOperatorForOperandSwap()
This commit is contained in:
parent
ffac614f7e
commit
110f956029
|
@ -1253,12 +1253,10 @@ void CheckOther::selfAssignmentError(const Token *tok, const std::string &varnam
|
||||||
|
|
||||||
static std::string invertOperatorForOperandSwap(std::string s)
|
static std::string invertOperatorForOperandSwap(std::string s)
|
||||||
{
|
{
|
||||||
for (std::string::size_type i = 0; i < s.length(); i++) {
|
if (s[0] == '<')
|
||||||
if (s[i] == '>')
|
s[0] = '>';
|
||||||
s[i] = '<';
|
else if (s[0] == '>')
|
||||||
else if (s[i] == '<')
|
s[0] = '<';
|
||||||
s[i] = '>';
|
|
||||||
}
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue