Skip to content
Snippets Groups Projects
Commit f49e7689 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: speed up for NOTFOUND

parent d655b652
No related branches found
No related tags found
No related merge requests found
......@@ -304,12 +304,18 @@ bool cmSystemTools::IsOn(const char* val)
bool cmSystemTools::IsNOTFOUND(const char* val)
{
cmsys::RegularExpression reg("-NOTFOUND$");
if(reg.find(val))
int len = strlen(val);
const char* notfound = "-NOTFOUND";
const int lenNotFound = 9;
if(len < lenNotFound-1)
{
return true;
return false;
}
if(len == lenNotFound-1)
{
return ( strcmp(val, "NOTFOUND") == 0);
}
return std::string("NOTFOUND") == val;
return ((strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment