From 62ad50864f6a10da7bd8bbc45bd3a985b307f724 Mon Sep 17 00:00:00 2001 From: north Date: Tue, 16 Feb 2010 00:35:03 +0000 Subject: [PATCH] efficiency improvement for agsubrep on mainnnode --- lib/cgraph/edge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index 415c5da95..5b4a0ef0d 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -161,8 +161,11 @@ Agsubnode_t *agsubrep(Agraph_t * g, Agnode_t * n) { Agsubnode_t *sn, template; - template.node = n; - sn = dtsearch(g->n_id, &template); + if (g == n->root) sn = &(n->mainsub); + else { + template.node = n; + sn = dtsearch(g->n_id, &template); + } return sn; } -- 2.40.0