Dieter Mayer
96f6fa44ad
Replace hash.keys().contains(k) with hash.contains(k) (35 call sites)
...
QHash/QMap::keys() allocates a list of every key on each call, then
contains() searches it linearly - an accidental O(n) plus allocation
where a direct O(1) lookup was meant. 35 occurrences across 7 files,
found while profiling project load times (context: #553/#560).
The hot one is ElementPictureFactory::getPictures(), which runs once
per element instance on project load: on the 3399 KiB example project
(191 instances, 129 cache hits) the keys() detour cost 45 ms of the
1.34 s total - measured, not estimated; the fix reproducibly shaves
~35-45 ms off that load. The remaining call sites are UI paths
(search&replace, dynamic text model, undo commands) where the waste
scales with selection/model size.
No behavior change: for QHash/QMap, keys().contains(k) and
contains(k) are equivalent by definition.
(cherry picked from commit 0a7f8f072fa68de7c01a9fc134a4bc8e16d62062)
2026-07-28 13:58:33 +02:00
..
2026-07-28 13:58:33 +02:00
2026-07-05 17:39:38 +02:00
2026-02-05 17:58:12 +09:00
2026-01-16 15:24:35 +01:00
2025-05-18 14:15:20 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-05-11 18:14:41 +00:00
2026-07-07 21:42:45 +02:00
2026-07-07 21:42:45 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2020-08-17 16:42:07 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2021-02-22 13:47:39 +01:00
2024-12-31 21:58:42 +01:00
2024-12-31 21:58:42 +01:00
2017-08-29 14:54:27 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2015-08-26 21:46:47 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2021-02-22 13:47:39 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2021-02-22 13:47:39 +01:00
2026-07-17 09:47:32 +02:00
2026-07-17 09:47:32 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-10-16 15:49:18 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2022-01-03 21:01:25 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2013-04-30 10:25:05 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-07-08 23:31:34 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2017-12-30 14:41:25 +00:00
2026-07-28 13:58:33 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-11-09 18:50:37 +00:00
2026-07-14 19:27:16 +02:00
2026-05-28 12:23:54 +02:00
2026-04-09 08:36:54 +02:00
2026-05-21 20:47:44 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2017-01-15 12:23:05 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-09-06 21:29:25 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2016-05-05 13:31:04 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-09-30 17:19:50 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2021-02-22 13:47:39 +01:00
2026-07-17 09:47:32 +02:00
2026-07-17 09:47:32 +02:00
2026-04-01 16:51:41 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2020-05-15 11:38:09 +02:00
2026-07-17 09:47:32 +02:00
2026-07-17 09:47:32 +02:00
2018-12-03 22:13:16 +00:00
2026-06-16 17:41:03 +02:00
2026-01-16 15:24:35 +01:00
2018-04-23 13:50:36 +00:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2015-08-29 14:18:30 +00:00
2026-06-22 17:30:20 +12:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2018-12-04 19:07:14 +00:00
2026-07-14 19:27:16 +02:00
2026-01-16 15:24:35 +01:00
2021-02-22 13:47:39 +01:00
2026-04-09 08:36:54 +02:00
2026-04-09 08:36:54 +02:00
2026-04-09 08:36:54 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2022-07-23 21:54:23 +02:00
2026-06-12 05:45:08 +12:00
2026-06-12 05:45:08 +12:00
2018-12-04 22:38:51 +00:00
2026-05-23 19:23:43 +02:00
2026-01-16 15:24:35 +01:00
2026-05-23 19:23:43 +02:00