summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine_unix.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-10 19:40:06 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-07-12 16:43:32 +0200
commit0fec7417ca305e52cfd1382b3f9f8e4adcb597de (patch)
treefb64708e431e298be05f5eb564cb8b4c76f63cf9 /src/network/socket/qnativesocketengine_unix.cpp
parent2d2e16d3ef267d0a130f84fc1f0a67476545a2b1 (diff)
QHash: optimize equality operator
- First compare the d-pointer before dipping into *d - Keep a running count as we calculate thisEqualRange, as std::distance() on QHash::iterator is very expensive. - Skip the pointless first comparison of the unadvanced iterator's key() with itself (found by Mårten Nordheim) Also rename (it, thisEqualRangeEnd) → (thisEqualRangeStart, it), to keep advancing `it`, which is more natural than advancing an `end` and later resetting it = end. Change-Id: I2c27c071b9ee23425a763328402dad9efee4cbd0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/network/socket/qnativesocketengine_unix.cpp')
0 files changed, 0 insertions, 0 deletions