summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorTóth Attila <toth.ata11@gmail.com>2018-12-31 20:46:14 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-12-31 21:55:40 +0100
commit079977df3f15bc393abe7541ca0769bc20f73b9d (patch)
tree5ccaa32f94979dce78bf7fe7497412a8b79a60d0 /basegfx
parent18b9f23f13fd503e94d669ab80b5d2354d1817a1 (diff)
cppcheck: Consider using std::count_if algorithm instead of a raw loop.
Change-Id: I994910cfba1d2ec63f48094f1ef5c52226ecf322 Reviewed-on: https://gerrit.libreoffice.org/65776 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dpolypolygontools.cxx10
1 files changed, 1 insertions, 9 deletions
diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx
index 20c92eef08bc..305934579ec5 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -174,15 +174,7 @@ namespace basegfx
}
else
{
- sal_Int32 nInsideCount(0);
-
- for(auto const& rPolygon : rCandidate)
- {
- if(isInside(rPolygon, rPoint, bWithBorder))
- {
- nInsideCount++;
- }
- }
+ sal_Int32 nInsideCount = std::count_if(rCandidate.begin(), rCandidate.end(), [rPoint, bWithBorder](B2DPolygon polygon){ return isInside(polygon, rPoint, bWithBorder); });
return (nInsideCount % 2);
}