summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-05-20 17:33:58 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2004-05-20 17:33:58 -0400
commit66288b115e9adb01933b1092fdd35a513774eb66 (patch)
tree5c29b261c772ddeed72799fb9ee64f6001ea49e1 /Source
parent3031467e33e61d9e7daa3357ee5f6b31c233e7fd (diff)
downloadcmake-66288b115e9adb01933b1092fdd35a513774eb66.tar.gz
ENH: remove regex use where strcmp is faster
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index a6872f168f..b6cd957ef4 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -304,12 +304,22 @@ 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)
+ {
+ return false;
+ }
+ if(strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0)
{
return true;
}
- return std::string("NOTFOUND") == val;
+ if(strcmp(val, "NOTFOUND") == 0)
+ {
+ return true;
+ }
+ return false;
}