From a3d1de8cd2a3d8ae50d308778ff7185aa9061292 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 12 Apr 2005 13:26:08 -0400 Subject: ENH: make regex static so it is not recomputed for each line of the cache --- Source/cmCacheManager.cxx | 8 ++++---- 1 file 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)) { -- cgit v0.12