]> granicus.if.org Git - graphviz/commitdiff
assign Cgraph IDs linearly
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Aug 2020 19:33:46 +0000 (12:33 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 8 Aug 2020 01:49:22 +0000 (18:49 -0700)
Previously Cgraph only assigned odd IDs from the internal counter, because even
IDs were reserved for pointers derived from agstrdup. Now that we no longer use
pointers as IDs there is nothing special about an ID being even or odd.

lib/cgraph/id.c

index 29ed46075bb6c199247c96fd500d4f2be77e0b86..62fadc8e888c98770137bd07bf59deb164b0276a 100644 (file)
@@ -32,7 +32,7 @@ static long idmap(void *state, int objtype, char *str, IDTYPE *id,
     NOTUSED(createflag);
 
     *id = ctr;
-    ctr += 2;
+    ++ctr;
 
     return TRUE;
 }