summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-02-24 17:09:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-25 08:06:57 +0100
commit435b64ecb6289a5ebfb8474f81dac032aaccfa4c (patch)
treeb105af973d612852dded93c5ed07ca4600ecd332 /dbaccess/source/ui/dlg/indexfieldscontrol.cxx
parent970ca8de0be4c4cd9485170f3c56a34b4069eec2 (diff)
Simplify containers iterations in dbaccess
Use range-based loop or replace with STL functions Change-Id: I01b4d97fa77ef8daf88e8e006b9523a6b71786cf Reviewed-on: https://gerrit.libreoffice.org/68286 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui/dlg/indexfieldscontrol.cxx')
-rw-r--r--dbaccess/source/ui/dlg/indexfieldscontrol.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index 3b0d83ed2403..27beb4654d78 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -166,13 +166,8 @@ static constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | Br
{
// do not just copy the array, we may have empty field names (which should not be copied)
_rFields.resize(m_aFields.size());
- IndexFields::iterator aDest = _rFields.begin();
- for (auto const& source : m_aFields)
- if (!source.sFieldName.isEmpty())
- {
- *aDest = source;
- ++aDest;
- }
+ IndexFields::iterator aDest = std::copy_if(m_aFields.begin(), m_aFields.end(), _rFields.begin(),
+ [](const OIndexField& source) { return !source.sFieldName.isEmpty(); });
_rFields.resize(aDest - _rFields.begin());
}