summaryrefslogtreecommitdiff
path: root/.cmake.conf
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-12-23 23:06:33 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-12-25 18:10:14 +0100
commit485727b41ed777ee9392be8aa770adb1b4415aa6 (patch)
treeff87b68ecf94b4aa1456026373d2d485deb35895 /.cmake.conf
parent20f0b58a24dabf17d5d1dcfc06eaa3ccafcd7268 (diff)
downloadqtwebchannel-485727b41ed777ee9392be8aa770adb1b4415aa6.tar.gz
SignalHandler: optimize remove(QObject*)
Don't look up the object in m_connectionCounter three times (contains(), value(), remove()). Instead, use find() to find it once, and std::move(it.value()) + erase() as a take() that can report whether the element existed in the container prior to extraction. This also means we can port the foreach loop to a ranged for loop now without hesitation: by erasing the element from the container before iterating over the QObject::disconnect() calls, we ensure immunity against a potential reentrance into the object (disconnectNotify() calls unknown code) that changes m_connectionsCounter, which the foreach loop was immune against (d/t taking a copy of the container under iteration). Change-Id: I6cf36c729f488bf1334fd344ddd0191db101d103 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Diffstat (limited to '.cmake.conf')
0 files changed, 0 insertions, 0 deletions