diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-05 14:48:20 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-05 15:59:23 +0200 |
commit | 5f15cc01b31ccaed0c6482a36556dece084ce302 (patch) | |
tree | ab5c82c5a261044f62965e0cdd333a2094fc20b1 /forms | |
parent | 801cb231f2e2b43f4befd9575e23da58d764c600 (diff) |
new loplugin: use more efficient find() methods
(Original idea from Kendy)
Look for code that is calling std::find on a sorted container
(set/map/vector) and warn about it - the code should be using
the find method on the container itself, since that is considerably faster.
Change-Id: Ib74e5d3faa836eeb0df16a736d202696626bdfd2
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/misc/InterfaceContainer.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 5b0efafedfb4..e740c3723f9f 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -680,9 +680,8 @@ throw (::com::sun::star::uno::RuntimeException, std::exception) { if (evt.PropertyName == PROPERTY_NAME) { ::osl::MutexGuard aGuard( m_rMutex ); - OInterfaceMap::iterator i = ::std::find(m_aMap.begin(), m_aMap.end(), - ::std::pair<const OUString, InterfaceRef >(::comphelper::getString(evt.OldValue),evt.Source)); - if (i != m_aMap.end()) + OInterfaceMap::iterator i = m_aMap.find(::comphelper::getString(evt.OldValue)); + if (i != m_aMap.end() && (*i).second != evt.Source) { InterfaceRef xCorrectType((*i).second); m_aMap.erase(i); |