[Cleanup] Remove always true condition in Strings::Commify() (#3193)

# Notes
- `i < 0` was always true.
This commit is contained in:
Alex King
2023-04-05 11:23:24 -04:00
committed by GitHub
parent fef2f9fc61
commit 1499f3338e
+2 -5
View File
@@ -287,15 +287,12 @@ std::string Strings::Commify(const std::string &number)
for (i = string_length - 3; i >= 0; i -= 3) {
if (i > 0) {
temp_string = "," + number.substr(static_cast<unsigned long>(i), 3) + temp_string;
}
else {
} else {
temp_string = number.substr(static_cast<unsigned long>(i), 3) + temp_string;
}
}
if (i < 0) {
temp_string = number.substr(0, static_cast<unsigned long>(3 + i)) + temp_string;
}
temp_string = number.substr(0, static_cast<unsigned long>(3 + i)) + temp_string;
return temp_string;
}