From b80c56f2798abca7b44ecf7c0fd9948a0b966e10 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 21 Nov 2018 02:49:30 +0300 Subject: Simplify containers iterations in svx/source/[a-e]* Use range-based loop or replace with STL functions Change-Id: I7a24407f9e8f38b4903a643210ca4511372d91f2 Reviewed-on: https://gerrit.libreoffice.org/63687 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/dialog/srchdlg.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'svx/source/dialog/srchdlg.cxx') diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 20cd94e06252..e86d1f4e9847 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1627,11 +1627,8 @@ void SvxSearchDialog::Remember_Impl( const OUString &rStr, bool _bSearch ) ComboBox* pListBox = _bSearch ? m_pSearchLB.get() : m_pReplaceLB.get(); // ignore identical strings - for (std::vector::const_iterator i = pArr->begin(); i != pArr->end(); ++i) - { - if ((*i) == rStr) - return; - } + if (std::find(pArr->begin(), pArr->end(), rStr) != pArr->end()) + return; // delete oldest entry at maximum occupancy (ListBox and Array) if(REMEMBER_SIZE < pArr->size()) -- cgit