ENH: remove regex use where strcmp is faster
This commit is contained in:
parent
3031467e33
commit
66288b115e
|
@ -304,12 +304,22 @@ bool cmSystemTools::IsOn(const char* val)
|
||||||
|
|
||||||
bool cmSystemTools::IsNOTFOUND(const char* val)
|
bool cmSystemTools::IsNOTFOUND(const char* val)
|
||||||
{
|
{
|
||||||
cmsys::RegularExpression reg("-NOTFOUND$");
|
int len = strlen(val);
|
||||||
if(reg.find(val))
|
const char* notfound = "-NOTFOUND";
|
||||||
|
const int lenNotFound = 9;
|
||||||
|
if(len < lenNotFound)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return std::string("NOTFOUND") == val;
|
if(strcmp(val, "NOTFOUND") == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue