Convert addRelation() to manipulate the tsort data from tsortInfo directly
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 18 Dec 2009 10:12:44 +0000 (12:12 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 21 Dec 2009 07:17:32 +0000 (09:17 +0200)
lib/order.c

index c1d7faf..d13211c 100644 (file)
@@ -174,10 +174,10 @@ static inline int addRelation(rpmts ts,
     }
 
     /* Save max. depth in dependency tree */
-    if (rpmteDepth(p) <= rpmteDepth(q))
-       (void) rpmteSetDepth(p, (rpmteDepth(q) + 1));
-    if (rpmteDepth(p) > ts->maxDepth)
-       ts->maxDepth = rpmteDepth(p);
+    if (tsi_p->depth <= tsi_q->depth)
+       tsi_p->depth = tsi_q->depth + 1;
+    if (tsi_p->depth > ts->maxDepth)
+       ts->maxDepth = tsi_p->depth;
 
     rel = xcalloc(1, sizeof(*rel));
     rel->rel_suc = p;