summaryrefslogtreecommitdiffstats
path: root/tests/manual/windowmodality
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-08-04 08:13:56 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-08-05 05:19:10 +0200
commitec40e505068c9e75d69f13666aa3f182cf2fc2c4 (patch)
treeb3f179a0dff07d19705f9398eaa4ecba62491068 /tests/manual/windowmodality
parentae0b080c019025c2a949cf9468294ecf2b4eacb1 (diff)
QXpmHandler: avoid double-lookup
The code used the if (!contains()) { insert() } anti-pattern, necessitated by Qt's deviation from the STL of allowing insert() to overwrite an existing entry, causing two lookups of the same key. Since QMap these days is a wrapper around std::map, fix by using the real thing (a std::map) instead, which sports the non-broken insert() semantics already, avoiding the need to play tricks like detecting a size increase in order to find whether an insertion took place. It also simplifies the loop later on, and we can transparently use pmr, when available. Change-Id: Iedd8d5691514a7705a55c27376446304b20af071 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/manual/windowmodality')
0 files changed, 0 insertions, 0 deletions