[geos-devel] [GEOS] #849: clang-tidy: readability-container-size-empty size() == 0 can be replaced with empty()

GEOS geos-trac at osgeo.org
Mon Aug 6 14:37:06 PDT 2018


#849: clang-tidy: readability-container-size-empty  size() == 0 can be replaced
with empty()
-------------------------------------------------+-------------------------
 Reporter:  goatbar                              |       Owner:  geos-
                                                 |  devel@…
     Type:  defect                               |      Status:  new
 Priority:  minor                                |   Milestone:  3.8.0
Component:  Default                              |     Version:  master
 Severity:  Unassigned                           |  Resolution:
 Keywords:  clangtidy size empty readability-    |
  container-size-empty                           |
-------------------------------------------------+-------------------------

Comment (by goatbar):

 See #860 for another case:

 {{{
 double
 ElevationMatrixCell::getAvg() const
 {
         return  zvals.size() ?  // <-- here
                 ztot / static_cast<double>(zvals.size()) :
                 DoubleNotANumber;
 }
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/849#comment:3>
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