diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-08-15 21:32:27 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-20 17:12:11 +0200 |
commit | 0787ce8814e37972a0c968f60008d4e8722b6e27 (patch) | |
tree | 9d2803ebda8813e6b3f2bc2e6f8a74953b2931c1 /xmloff | |
parent | d2c9c60fefb9687adbde4be61ed66a5123a2587f (diff) |
Simplify containers iterations, tdf#96099 follow-up
Use range-based loop or replace with std::any_of, std::find and
std::find_if where applicable.
Change-Id: I2f80788c49d56094c29b102eb96a7a7c079567c6
Reviewed-on: https://gerrit.libreoffice.org/59143
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 3f5ac56b279a..eadf77c4d3a3 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2612,11 +2612,7 @@ bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange( o_rXmlId = std::get<1>(rEntry); o_rpRDFaAttributes = std::get<2>(rEntry); m_xImpl->m_BookmarkStartRanges.erase(sName); - auto it(m_xImpl->m_BookmarkVector.begin()); - while (it != m_xImpl->m_BookmarkVector.end() && *it != sName) - { - ++it; - } + auto it = std::find(m_xImpl->m_BookmarkVector.begin(), m_xImpl->m_BookmarkVector.end(), sName); if (it!=m_xImpl->m_BookmarkVector.end()) { m_xImpl->m_BookmarkVector.erase(it); |