diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-29 13:22:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-29 19:52:14 +0200 |
commit | 29de154fdfd5ce69ec906e04823c7d1cbbbbcdf9 (patch) | |
tree | aa1365708a9c21f21e6ab33eea7fc47b44ca9260 /include/comphelper/interfacecontainer4.hxx | |
parent | 2c4aabb220ad1e8f1cbc75f2361fe17893d7cc29 (diff) |
tdf#126788 reduce cost of OInterfaceContainerHelper4::disposeAndClear
use the empty singleton to avoid allocating an empty vector
Change-Id: I2eb80228a870414fd253cdbe8d281610d2d3115d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142018
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper/interfacecontainer4.hxx')
-rw-r--r-- | include/comphelper/interfacecontainer4.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/comphelper/interfacecontainer4.hxx b/include/comphelper/interfacecontainer4.hxx index 20429954d56d..6ec1ca7179e2 100644 --- a/include/comphelper/interfacecontainer4.hxx +++ b/include/comphelper/interfacecontainer4.hxx @@ -369,7 +369,8 @@ void OInterfaceContainerHelper4<ListenerT>::disposeAndClear(std::unique_lock<std const css::lang::EventObject& rEvt) { OInterfaceIteratorHelper4<ListenerT> aIt(rGuard, *this); - maData->clear(); + maData + = DEFAULT(); // cheaper than calling maData->clear() because it doesn't allocate a new vector rGuard.unlock(); // unlock followed by iterating is only safe because we are not going to call remove() on the iterator while (aIt.hasMoreElements()) |