mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-24 08:47:59 +00:00
pvs-studio: (V555) Clarify size_type comparison
The expression 'r - l > 0' implies a sign to r and l that does not exist.
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
//-V::539
|
||||
# Expression is always true/false.
|
||||
//-V::547
|
||||
# Expression of the 'A - B > 0' kind will work as 'A != B'.
|
||||
//-V::555
|
||||
# Possible array overrun.
|
||||
//-V::557
|
||||
# Part of conditional expression is always true/false.
|
||||
|
||||
@@ -93,7 +93,7 @@ void cmStringReplaceHelper::ParseReplaceExpression()
|
||||
this->Replacements.emplace_back(
|
||||
this->ReplaceExpression.substr(l, r - l));
|
||||
} else {
|
||||
if (r - l > 0) {
|
||||
if (r != l) {
|
||||
this->Replacements.emplace_back(
|
||||
this->ReplaceExpression.substr(l, r - l));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user