Update cockatrice/src/game/filters/filter_string.cpp

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
Paul Carroll 2025-08-19 11:29:30 -04:00 committed by GitHub
parent 6c6e36a89e
commit b04a5559c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,9 +201,8 @@ static void setupParserRules()
// Check cache first with thread safety
QMutexLocker locker(&regexCacheMutex);
auto it = regexCache.find(pattern);
if (it != regexCache.end()) {
QRegularExpression cachedRegex = it.value();
if (regexCache.contains(pattern)) {
QRegularExpression cachedRegex = regexCache.value(pattern);
locker.unlock();
return [cachedRegex](const QString &s) { return cachedRegex.match(s).hasMatch(); };
}