MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / GetCachedPCRE

Function GetCachedPCRE

extern/re2/re2/testing/regexp_benchmark.cc:960–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958}
959
960PCRE* GetCachedPCRE(const char* regexp) {
961 static auto& mutex = *new Mutex;
962 MutexLock lock(&mutex);
963 static auto& cache = *new std::unordered_map<std::string, PCRE*>;
964 PCRE* re = cache[regexp];
965 if (re == NULL) {
966 re = new PCRE(regexp, PCRE::UTF8);
967 CHECK_EQ(re->error(), "");
968 cache[regexp] = re;
969 }
970 return re;
971}
972
973RE2* GetCachedRE2(const char* regexp) {
974 static auto& mutex = *new Mutex;

Callers 5

SearchCachedPCREFunction · 0.85
Parse3CachedPCREFunction · 0.85
Parse1CachedPCREFunction · 0.85
SearchParse2CachedPCREFunction · 0.85
SearchParse1CachedPCREFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected