From 32c0a8066f45471bd0ee290c89b720ecd567a32b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 19 Nov 2022 16:09:10 -0800 Subject: [PATCH] neatogen makeInfo: use a clearer iteration idiom --- lib/neatogen/adjust.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index d5eae6376..7ede420fa 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -131,7 +131,6 @@ static void chkBoundBox(Agraph_t * graph) static int makeInfo(Agraph_t * graph) { Agnode_t *node; - Info_t *ip; expand_t pmargin; int (*polyf)(Poly *, Agnode_t *, float, float); @@ -142,7 +141,6 @@ static int makeInfo(Agraph_t * graph) nodeInfo = gv_calloc(nsites, sizeof(Info_t)); node = agfstnode(graph); - ip = nodeInfo; pmargin = sepFactor (graph); @@ -155,6 +153,7 @@ static int makeInfo(Agraph_t * graph) else polyf = makePoly; for (size_t i = 0; i < nsites; i++) { + Info_t *ip = &nodeInfo[i]; ip->site.coord.x = ND_pos(node)[0]; ip->site.coord.y = ND_pos(node)[1]; @@ -169,7 +168,6 @@ static int makeInfo(Agraph_t * graph) ip->node = node; ip->verts = NULL; node = agnxtnode(graph, node); - ip++; } return 0; } -- 2.40.0