[geos-devel] [GEOS] #860: Prefer empty to size of zero

GEOS geos-trac at osgeo.org
Mon Mar 19 10:56:19 PDT 2018


#860: Prefer empty to size of zero
------------------------+---------------------------
 Reporter:  goatbar     |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:  3.6.3
Component:  Default     |     Version:  3.6.2
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by goatbar):

 And there are some easy to find instances of the same thing:

 {{{
 find . -name \*.cpp | xargs egrep '[.]size()' | egrep '== *0|0 *=='
 ./geomgraph/EdgeEndStar.cpp:    if (edgeMap.size()==0) return nullCoord;
 ./geomgraph/EdgeEndStar.cpp:    if (edgeMap.size()==0) return true;
 ./operation/buffer/SubgraphDepthLocater.cpp:    if
 (stabbedSegments.size()==0) return 0;
 ./operation/overlay/LineBuilder.cpp:    if ( v3d.size() == 0 )
 ./linearref/ExtractLineByLocation.cpp:  if (newCoordinateArray.size() ==
 0)
 }}}

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