]> granicus.if.org Git - graphviz/commitdiff
Fix logic for loopless graphs
authorEmden R. Gansner <erg@alum.mit.edu>
Thu, 17 Apr 2014 15:56:07 +0000 (11:56 -0400)
committerEmden R. Gansner <erg@alum.mit.edu>
Thu, 17 Apr 2014 15:56:07 +0000 (11:56 -0400)
lib/cgraph/edge.c

index cb8191ac90aad6015c91d1bf03c3be82ac35f86e..0e491eae6d6efea11ef751b8f3dee6d25ba4a485 100644 (file)
@@ -246,13 +246,13 @@ static int ok_to_make_edge(Agraph_t * g, Agnode_t * t, Agnode_t * h)
 
     /* protect against self, multi-edges in strict graphs */
     if (agisstrict(g)) {
-       if (g->desc.no_loop && (t == h)) /* simple graphs */
-           return FALSE;
        key = Tag;
        key.objtype = 0;        /* wild card */
        if (agfindedge_by_key(g, t, h, key))
            return FALSE;
     }
+    if (g->desc.no_loop && (t == h)) /* simple graphs */
+       return FALSE;
     return TRUE;
 }