From b04a5559c2922696dd942cec34d86845bceb753e Mon Sep 17 00:00:00 2001 From: Paul Carroll <57120760+carrollpaul@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:29:30 -0400 Subject: [PATCH] Update cockatrice/src/game/filters/filter_string.cpp Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com> --- cockatrice/src/game/filters/filter_string.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/game/filters/filter_string.cpp b/cockatrice/src/game/filters/filter_string.cpp index 3a1a11246..60ebed1e6 100644 --- a/cockatrice/src/game/filters/filter_string.cpp +++ b/cockatrice/src/game/filters/filter_string.cpp @@ -201,9 +201,8 @@ static void setupParserRules() // Check cache first with thread safety QMutexLocker locker(®exCacheMutex); - 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(); }; }