summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-26 08:31:34 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-01-27 01:36:04 +0100
commit97b465455bfd53b7ff72a6bad0b77060727cc1c2 (patch)
tree0ed8e4a1338119505cb13f289834f2e1c73e9ae3
parent4ecbebebf7bfe1eaf5685abca9e068087587df03 (diff)
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 <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/time/qcalendar.cpp3
1 files changed, 2 insertions, 1 deletions
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);
}
/*