From 19be86249dcc5b13b3c95f5469600fa2bc1b749b Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 14 Oct 2018 12:00:03 +0300 Subject: Simplify containers iterations in vcl Use range-based loop or replace with STL functions. Change-Id: Ide2f89194238ae6a1f21e8132e2297710d9e6dcd Reviewed-on: https://gerrit.libreoffice.org/61756 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/workben/vcldemo.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'vcl/workben') diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 9b9b088e9b94..6b2db288d87d 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1504,14 +1504,9 @@ public: void addInvalidate(vcl::Window *pWindow) { maInvalidates.emplace_back(pWindow); }; void removeInvalidate(vcl::Window *pWindow) { - for (auto aIt = maInvalidates.begin(); aIt != maInvalidates.end(); ++aIt) - { - if (*aIt == pWindow) - { - maInvalidates.erase(aIt); - return; - } - } + auto aIt = std::find(maInvalidates.begin(), maInvalidates.end(), pWindow); + if (aIt != maInvalidates.end()) + maInvalidates.erase(aIt); } void Invalidate() { -- cgit