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-14 19:27:18 +02:00
2026-07-14 19:27:17 +02:00
2026-06-16 17:41:03 +02:00
2026-01-16 15:24:35 +01:00
2026-01-26 18:47:43 +01:00
2026-07-19 11:51:47 +02:00
2026-07-23 13:58:56 +02:00
2026-07-28 13:58:33 +02:00
2026-07-26 21:04:25 +12:00
2026-07-11 21:47:04 +02:00
2026-07-17 21:01:26 +02:00
2026-01-16 15:24:35 +01:00
2026-07-18 08:00:23 +02:00
2026-01-16 15:24:35 +01:00
2025-05-22 21:33:32 +02:00
2026-07-18 08:00:23 +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
2025-02-12 13:41:39 +01:00
2026-07-28 13:58:33 +02:00
2026-01-16 15:24:35 +01:00
2026-07-17 10:26:43 +02:00
2026-07-17 10:26:35 +02:00
2026-07-28 13:58:33 +02: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
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-07-14 19:27:18 +02:00
2026-06-12 05:25:44 +12:00
2026-06-16 17:41:03 +02:00
2026-01-16 15:24:35 +01:00
2026-06-16 17:41:03 +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
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
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-14 19:27:16 +02:00
2026-06-16 17:41:03 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-14 19:27:16 +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
2026-01-16 15:24:35 +01:00
2026-07-17 21:01:26 +02:00
2026-04-26 10:48:47 +02:00
2026-06-12 05:34:20 +12:00
2026-04-26 10:48:47 +02:00
2026-07-14 19:27:16 +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-07-14 19:27:17 +02:00
2026-01-16 15:24:35 +01:00
2026-06-16 17:41:03 +02:00
2026-01-16 15:24:35 +01:00
2026-05-13 19:42:11 +02:00
2026-05-13 19:42:11 +02:00
2026-07-14 19:48:31 +02:00
2026-05-29 19:14:36 +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
2026-06-21 01:45:07 +12:00
2026-01-16 15:24:35 +01:00
2026-06-18 13:37:24 +02:00
2026-06-18 13:37:24 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-06-21 01:45:07 +12:00
2026-04-19 10:44:52 +02:00
2026-07-17 10:25:49 +02:00
2026-06-20 22:31:06 +12:00
2026-07-14 19:27:37 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-06-11 23:48:14 +12:00
2026-06-11 23:48:14 +12:00
2026-05-13 19:42:11 +02:00
2026-05-13 19:42:11 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-26 15:32:11 +02:00
2026-06-21 12:10:13 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-07 21:42:45 +02:00
2026-07-07 16:34:56 +02:00
2026-02-02 14:44:10 +01:00
2026-02-02 14:44:10 +01:00
2026-05-28 12:23:54 +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
2026-01-16 15:24:35 +01:00
2026-07-27 17:37:49 +12:00
2026-07-07 16:34:56 +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
2026-07-19 13:26:34 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-17 10:25:49 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-17 21:01:26 +02:00
2026-07-17 21:01:26 +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
2026-07-17 10:29:13 +02:00
2026-07-17 10:29:13 +02:00
2020-09-07 22:03:40 +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-07-17 21:01:26 +02:00
2026-01-16 15:24:35 +01:00
2020-09-07 22:03:40 +02:00
2026-01-16 15:24:35 +01:00
2026-06-11 12:39:43 +12:00
2026-06-11 12:39:43 +12:00