diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-26 08:31:34 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-27 06:55:07 +0000 |
commit | 0aea581c4e2f0db90d13f28a8c5830faa1d2404f (patch) | |
tree | b57b471d98bcf37e2ea9c2544e3bd3ff707fc130 | |
parent | ec000d6bad334325812a5812500eda89a65d50fb (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...
Change-Id: Ifbb832a06991b9ee9a1fd6a43db567bb572fca4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97b465455bfd53b7ff72a6bad0b77060727cc1c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/corelib/time/qcalendar.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/time/qcalendar.cpp b/src/corelib/time/qcalendar.cpp index 2f02a71ba4..adefa99ee9 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); } /* |