From 9ab9d69c7da783d0c528ce58f9c8af54990eae6c Mon Sep 17 00:00:00 2001 From: Kayo Hamid Date: Fri, 22 Apr 2011 11:31:13 +0200 Subject: [PATCH] cppcheck inefficient checking for emptiness From cppcheck: Using xxxx.empty() instead of xxxx.size() can be faster. xxxx.size() can take linear time but xxxx.empty() is guaranteed to take constant time --- basegfx/source/polygon/b2dpolypolygoncutter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index b6dad1e917fa..1b15b953e29e 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -933,7 +933,7 @@ namespace basegfx // first step: prepareForPolygonOperation and simple merge of non-overlapping // PolyPolygons for speedup; this is possible for the wanted OR-operation - if(aInput.size()) + if(!aInput.empty()) { std::vector< basegfx::B2DPolyPolygon > aResult; aResult.reserve(aInput.size()); @@ -942,7 +942,7 @@ namespace basegfx { const basegfx::B2DPolyPolygon aCandidate(prepareForPolygonOperation(aInput[a])); - if(aResult.size()) + if(!aResult.empty()) { const B2DRange aCandidateRange(aCandidate.getB2DRange()); bool bCouldMergeSimple(false);