mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 06:40:48 -06:00
IsOff: Use the length for the string construction
No need to waste the calculation and force the string to call strlen again.
This commit is contained in:
@@ -406,11 +406,12 @@ bool cmSystemTools::IsNOTFOUND(const char* val)
|
||||
|
||||
bool cmSystemTools::IsOff(const char* val)
|
||||
{
|
||||
if (!val || strlen(val) == 0)
|
||||
if (!val || !*val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
std::basic_string<char> v = val;
|
||||
size_t len = val ? strlen(val) : 0;
|
||||
std::basic_string<char> v(val, len);
|
||||
|
||||
for(std::basic_string<char>::iterator c = v.begin();
|
||||
c != v.end(); c++)
|
||||
|
||||
Reference in New Issue
Block a user