diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-04-30 17:12:29 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2014-06-09 18:45:35 (GMT) |
commit | 3e7194a215aed5e34acf32ad4b8c6bd948beb15e (patch) | |
tree | d64f0613579fdf8fda51ce8fd05f6045a3a2142e /Source/cmOrderDirectories.cxx | |
parent | 9e8fa1043ce9bfcffdcfa395f618dd7958ef4251 (diff) | |
download | CMake-3e7194a215aed5e34acf32ad4b8c6bd948beb15e.zip CMake-3e7194a215aed5e34acf32ad4b8c6bd948beb15e.tar.gz CMake-3e7194a215aed5e34acf32ad4b8c6bd948beb15e.tar.bz2 |
regex: Use static regexs where possible
Rather than declaring and compiling a constant regex every time a chunk
of code is executed, build the regex once.
Diffstat (limited to 'Source/cmOrderDirectories.cxx')
-rw-r--r-- | Source/cmOrderDirectories.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index ec671fc..71a3497 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -39,8 +39,8 @@ public: if(file.rfind(".framework") != std::string::npos) { - cmsys::RegularExpression splitFramework; - splitFramework.compile("^(.*)/(.*).framework/(.*)$"); + static cmsys::RegularExpression + splitFramework("^(.*)/(.*).framework/(.*)$"); if(splitFramework.find(file) && (std::string::npos != splitFramework.match(3).find(splitFramework.match(2)))) @@ -326,8 +326,8 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath, if(fullPath.rfind(".framework") != std::string::npos) { - cmsys::RegularExpression splitFramework; - splitFramework.compile("^(.*)/(.*).framework/(.*)$"); + static cmsys::RegularExpression + splitFramework("^(.*)/(.*).framework/(.*)$"); if(splitFramework.find(fullPath) && (std::string::npos != splitFramework.match(3).find(splitFramework.match(2)))) |