From 3a6031a99f4b3e18ca69a37a3c6381b0bcfeb6e4 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 9 Feb 2024 17:25:18 +0100 Subject: [PATCH] QTzTimeZoneCache: make findEntry() static It doesn't need access to the members, so making it static both saves the implicit this pointer, and communicates to the reader that this is function doesn't access other QTzTimeZoneCache members. In particular, it proves that it doesn't really need to be called with m_mutex locked, cf. QTBUG-122138. Task-number: QTBUG-122138 Change-Id: I28c99be8d066c1647aaf7aa256b6400a6dd92955 Reviewed-by: Thiago Macieira (cherry picked from commit 7862453ba9cbcb601b9aad59dd821ae49661de4a) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 3265e2467d5312d16a2b30d66770abad2af6705a) (cherry picked from commit c4b0d1bd6d281f0c166d8ef3fa0cb69b9aed9cdc) --- src/corelib/time/qtimezoneprivate_tz.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp index 0740f4dfe96..a520c707552 100644 --- a/src/corelib/time/qtimezoneprivate_tz.cpp +++ b/src/corelib/time/qtimezoneprivate_tz.cpp @@ -772,7 +772,7 @@ public: QTzTimeZoneCacheEntry fetchEntry(const QByteArray &ianaId); private: - QTzTimeZoneCacheEntry findEntry(const QByteArray &ianaId); + static QTzTimeZoneCacheEntry findEntry(const QByteArray &ianaId); QCache m_cache; QMutex m_mutex; };