]> granicus.if.org Git - graphviz/commitdiff
RTreeInsert2: move definition of i closer to its use
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Mar 2021 03:51:47 +0000 (20:51 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 31 Mar 2021 00:05:59 +0000 (17:05 -0700)
lib/label/index.c

index 4559468a20833c35c809cf7a93ee33c919192658..ada4df4f55ef22dde58314703b6b26aeefab10a3 100644 (file)
@@ -275,7 +275,6 @@ static int
 RTreeInsert2(RTree_t * rtp, Rect_t * r, void *data,
             Node_t * n, Node_t ** new, int level)
 {
-    int i=0;
     Branch_t b;
     Node_t *n2=0;
 
@@ -291,7 +290,7 @@ RTreeInsert2(RTree_t * rtp, Rect_t * r, void *data,
 
     /* Still above level for insertion, go down tree recursively */
     if (n->level > level) {
-       i = PickBranch(r, n);
+       int i = PickBranch(r, n);
        if (!RTreeInsert2(rtp, r, data, n->branch[i].child, &n2, level)) {      /* recurse: child was not split */
            n->branch[i].rect = CombineRect(r, &(n->branch[i].rect));
            return 0;