From 97b465455bfd53b7ff72a6bad0b77060727cc1c2 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 26 Jan 2022 08:31:34 +0100 Subject: QCalendar: move memory allocation out of critical section By Amdahl's Law, provides for more scalability. This is just for backporting. The registry should really be able to perform lookups without allocating memory... Pick-to: 6.3 6.2 Change-Id: Ifbb832a06991b9ee9a1fd6a43db567bb572fca4f Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/corelib/time/qcalendar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/time/qcalendar.cpp b/src/corelib/time/qcalendar.cpp index fe75be3a6a..7bfcbf49ac 100644 --- a/src/corelib/time/qcalendar.cpp +++ b/src/corelib/time/qcalendar.cpp @@ -379,8 +379,9 @@ const QCalendarBackend *QCalendarRegistry::fromName(QAnyStringView name) { ensurePopulated(); + const QString nameU16 = name.toString(); QReadLocker locker(&lock); - return byName.value(name.toString(), nullptr); + return byName.value(nameU16, nullptr); } /* -- cgit v1.2.3