mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Update cockatrice/src/game/filters/filter_string.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
6c6e36a89e
commit
b04a5559c2
1 changed files with 2 additions and 3 deletions
|
|
@ -201,9 +201,8 @@ static void setupParserRules()
|
||||||
|
|
||||||
// Check cache first with thread safety
|
// Check cache first with thread safety
|
||||||
QMutexLocker locker(®exCacheMutex);
|
QMutexLocker locker(®exCacheMutex);
|
||||||
auto it = regexCache.find(pattern);
|
if (regexCache.contains(pattern)) {
|
||||||
if (it != regexCache.end()) {
|
QRegularExpression cachedRegex = regexCache.value(pattern);
|
||||||
QRegularExpression cachedRegex = it.value();
|
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
return [cachedRegex](const QString &s) { return cachedRegex.match(s).hasMatch(); };
|
return [cachedRegex](const QString &s) { return cachedRegex.match(s).hasMatch(); };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue