diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-04-12 17:26:08 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-04-12 17:26:08 (GMT) |
commit | a3d1de8cd2a3d8ae50d308778ff7185aa9061292 (patch) | |
tree | 32078025810eac826054107b2972df37573f8af3 /Source/cmCacheManager.cxx | |
parent | 266d5d16df0c5e0356b70fe8a44c4da78814a821 (diff) | |
download | CMake-a3d1de8cd2a3d8ae50d308778ff7185aa9061292.zip CMake-a3d1de8cd2a3d8ae50d308778ff7185aa9061292.tar.gz CMake-a3d1de8cd2a3d8ae50d308778ff7185aa9061292.tar.bz2 |
ENH: make regex static so it is not recomputed for each line of the cache
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r-- | Source/cmCacheManager.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 887b0f4..075e908 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -83,9 +83,9 @@ bool cmCacheManager::ParseEntry(const char* entry, std::string& value) { // input line is: key:type=value - cmsys::RegularExpression reg("^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); + static cmsys::RegularExpression reg("^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); // input line is: "key":type=value - cmsys::RegularExpression regQuoted("^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); + static cmsys::RegularExpression regQuoted("^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); bool flag = false; if(regQuoted.find(entry)) { @@ -120,9 +120,9 @@ bool cmCacheManager::ParseEntry(const char* entry, CacheEntryType& type) { // input line is: key:type=value - cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); + static cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); // input line is: "key":type=value - cmsys::RegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); + static cmsys::RegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$"); bool flag = false; if(regQuoted.find(entry)) { |