]> granicus.if.org Git - postgis/commitdiff
Fix comments up on cmp() func
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 13 Sep 2017 17:22:03 +0000 (17:22 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 13 Sep 2017 17:22:03 +0000 (17:22 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15711 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_serialized.c

index 84d16b78caa1a3080290ebfaff5f8e680ce00d01..69882aadd5469f8aca539a3b950144a296042639 100644 (file)
@@ -317,7 +317,9 @@ int gserialized_cmp(const GSERIALIZED *g1, const GSERIALIZED *g2)
        if ( bsz1 == bsz2 && srid1 == srid2 && cmp == 0 )
                return 0;
        
-       /* using the centroids, and preferring the X axis */
+       /* Using the centroids, calculate somewhat sortable */
+    /* hash key. The key doesn't provide good locality over */
+    /* the +/- boundary, but otherwise is pretty OK */
        hash1 = gbox_get_sortable_hash(&box1);
        hash2 = gbox_get_sortable_hash(&box2);
 
@@ -349,13 +351,13 @@ int gserialized_cmp(const GSERIALIZED *g1, const GSERIALIZED *g2)
        else if (box1.ymax > box2.ymax)
                return 1;
 
-       /* How about object size? Sort on that... */
+       /* Geeze! How about object size? Sort on that... */
        if (hsz1 < hsz2)
                return -1;
        else if (hsz1 > hsz2)
                return 1;
        
-       /* Well, they aren't memcmp equal, so we'll sort on the memcmp */
+       /* OK fine, we'll sort on the memcmp just to be done with this */
        return cmp == 0 ? 0 : (cmp > 0 ? 1 : -1);
 }