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
This commit is contained in:
Kayo Hamid 2011-04-22 11:31:13 +02:00 committed by Cédric Bosdonnat
parent cdc7c5772a
commit 9ab9d69c7d

View File

@ -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);