Kaydet (Commit) e463ab92 authored tarafından Noel Grandin's avatar Noel Grandin

std::list->std::vector in sw::WriterMultiListener

for small objects like pointers, much more cache-friendly

Change-Id: I37a77c437fd53f5774e9752565f463f764f29c9a
Reviewed-on: https://gerrit.libreoffice.org/52562Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 3a5a3ebe
......@@ -26,7 +26,7 @@
#include "ring.hxx"
#include "hintids.hxx"
#include <type_traits>
#include <list>
#include <vector>
#include <memory>
......@@ -265,7 +265,7 @@ namespace sw
typedef std::unique_ptr<SwDepend> pointer_t;
#endif
SwClient& m_rToTell;
std::list<pointer_t> m_vDepends;
std::vector<pointer_t> m_vDepends;
public:
WriterMultiListener(SwClient& rToTell)
: m_rToTell(rToTell) {}
......
......@@ -314,10 +314,13 @@ bool sw::WriterMultiListener::IsListeningTo(const SwModify* const pBroadcaster)
void sw::WriterMultiListener::EndListening(SwModify* pBroadcaster)
{
m_vDepends.remove_if( [&pBroadcaster](const pointer_t& pListener)
{
return pListener->GetRegisteredIn() == nullptr || pListener->GetRegisteredIn() == pBroadcaster;
});
m_vDepends.erase(
std::remove_if( m_vDepends.begin(), m_vDepends.end(),
[&pBroadcaster](const pointer_t& pListener)
{
return pListener->GetRegisteredIn() == nullptr || pListener->GetRegisteredIn() == pBroadcaster;
}),
m_vDepends.end());
}
void sw::WriterMultiListener::EndListeningAll()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment