[geos-devel] [GEOS] #832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons

GEOS geos-trac at osgeo.org
Sun Apr 23 12:13:13 PDT 2017


#832: LinearLocation::isValid and LinearLocation::normalize, faulty comparisons
------------------------+---------------------------
 Reporter:  nila        |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  svn-trunk
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------

Comment (by nila):

 I cannot see the always-false comparison would introduce any bad
 conseqence as such. The code is a pretty straightforward port from JTS
 with the exception of componentIndex and segmentIndex being unsigned here,
 while they are signed in JTS. In JTS the comparisons are needed, but here
 they are redundant. The LinearLocation::normalize can therefore be reduced
 by 11 lines and 2 lines in LinearLocation::isValid can be shortened (and 4
 Clang warnings can be silenced).

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