]> granicus.if.org Git - graphviz/commitdiff
condense some compound assignments
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 02:57:29 +0000 (19:57 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Jun 2021 02:32:59 +0000 (19:32 -0700)
lib/common/routespl.c

index 7346af66507f53ebbcfd7a779d984ed9565fca8b..66016eff0eb5bde71befd781f8f4d7f641d8c260 100644 (file)
@@ -837,8 +837,8 @@ static pointf get_centroid(Agraph_t *g)
         sum.y += ND_pos(n)[1];
         cnt++;
     }
-    sum.x = sum.x / cnt;
-    sum.y = sum.y / cnt;
+    sum.x /= cnt;
+    sum.y /= cnt;
     return sum;
 }
 
@@ -1080,8 +1080,8 @@ static pointf get_cycle_centroid(graph_t *g, edge_t* edge)
         cnt++;
        }
 
-       sum.x = sum.x / cnt;
-    sum.y = sum.y / cnt;
+       sum.x /= cnt;
+    sum.y /= cnt;
     return sum;
 }