[geos-devel] [GEOS] #849: clang-tidy: readability-container-size-empty site() == 0 can be replaced with empty()
GEOS
geos-trac at osgeo.org
Fri Jan 5 10:22:31 PST 2018
#849: clang-tidy: readability-container-size-empty site() == 0 can be replaced
with empty()
-------------------------+-------------------------------------------------
Reporter: goatbar | Owner: geos-devel@…
Type: defect | Status: new
Priority: minor | Milestone: 3.6.3
Component: Default | Version: master
Severity: Unassigned | Keywords: clangtidy size empty readability-
| container-size-empty
-------------------------+-------------------------------------------------
https://clang.llvm.org/extra/clang-tidy/checks/readability-container-size-
empty.html
There are at least 9 of these
e.g.
{{{#!c++
std::size_t
CoordinateArraySequence::getDimension() const
{
if( dimension != 0 )
return dimension;
if( vect->size() == 0 )
return 3;
if( ISNAN((*vect)[0].z) )
dimension = 2;
else
dimension = 3;
return dimension;
}
}}}
Could be
{{{#!c++
std::size_t
CoordinateArraySequence::getDimension() const
{
if( dimension != 0 )
return dimension;
if( vect->empty() ) // <<-- fix here
return 3;
if( ISNAN((*vect)[0].z) )
dimension = 2;
else
dimension = 3;
return dimension;
}
}}}
--
Ticket URL: <https://trac.osgeo.org/geos/ticket/849>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
More information about the geos-devel
mailing list