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>
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user