]> granicus.if.org Git - postgis/commitdiff
Simplify loop / make more readable
authorSandro Santilli <strk@kbt.io>
Fri, 23 Sep 2016 17:38:30 +0000 (17:38 +0000)
committerSandro Santilli <strk@kbt.io>
Fri, 23 Sep 2016 17:38:30 +0000 (17:38 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15131 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/ptarray.c

index 44e8fc06c838a40474b6f8cd727ffec80b66f33e..3bf4fcfd82b54a9b60c4d7692069e0d9b8832f9e 100644 (file)
@@ -986,9 +986,9 @@ ptarray_signed_area(const POINTARRAY *pa)
        P1 = getPoint2d_cp(pa, 0);
        P2 = getPoint2d_cp(pa, 1);
        x0 = P1->x;
-       for ( i = 1; i < pa->npoints - 1; i++ )
+       for ( i = 2; i < pa->npoints; i++ )
        {
-               P3 = getPoint2d_cp(pa, i+1);
+               P3 = getPoint2d_cp(pa, i);
                x = P2->x - x0;
                y1 = P3->y;
                y2 = P1->y;