diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-12-21 12:18:22 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-12-21 12:18:22 +0200 |
commit | 134c19d9fab97a7c03149893c356e6fa794c0318 (patch) | |
tree | afda4ff12bd4e7c2873b63f247442fbc591f656b /lib | |
parent | 9b12bc126763b4723be4c7c1e44406b2f00f5759 (diff) | |
download | librpm-tizen-134c19d9fab97a7c03149893c356e6fa794c0318.tar.gz librpm-tizen-134c19d9fab97a7c03149893c356e6fa794c0318.tar.bz2 librpm-tizen-134c19d9fab97a7c03149893c356e6fa794c0318.zip |
Avoid a bunch of redundant rpmteTSI() calls
Diffstat (limited to 'lib')
-rw-r--r-- | lib/order.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/order.c b/lib/order.c index ae4758eda..66da919cb 100644 --- a/lib/order.c +++ b/lib/order.c @@ -467,15 +467,16 @@ static void collectSCC(rpm_color_t prefcolor, rpmte p, rpmte * newOrder, int * newOrderCount, scc SCCs, rpmte * queue_end) { - int sccNr = rpmteTSI(p)->tsi_SccIdx; + tsortInfo p_tsi = rpmteTSI(p); + int sccNr = p_tsi->tsi_SccIdx; struct scc_s SCC = SCCs[sccNr]; int i; int start, end; relation rel; /* remove p from the outer queue */ - rpmte outer_queue_start = rpmteTSI(p)->tsi_suc; - rpmteTSI(p)->tsi_suc = NULL; + rpmte outer_queue_start = p_tsi->tsi_suc; + p_tsi->tsi_suc = NULL; /* * Run a multi source Dijkstra's algorithm to find relations @@ -570,7 +571,7 @@ static void collectSCC(rpm_color_t prefcolor, rpmte p, } /* restore outer queue */ - rpmteTSI(p)->tsi_suc = outer_queue_start; + p_tsi->tsi_suc = outer_queue_start; } int rpmtsOrder(rpmts ts) @@ -650,16 +651,17 @@ int rpmtsOrder(rpmts ts) } } - /* Process queue */ - for (; q != NULL; q = rpmteTSI(q)->tsi_suc) { + while (q != NULL) { + tsortInfo q_tsi = rpmteTSI(q); /* Mark the package as unqueued. */ - rpmteTSI(q)->tsi_reqx = 0; - if (rpmteTSI(q)->tsi_SccIdx > 1) { + q_tsi->tsi_reqx = 0; + if (q_tsi->tsi_SccIdx > 1) { collectSCC(prefcolor, q, newOrder, &newOrderCount, SCCs, &r); } else { collectTE(prefcolor, q, newOrder, &newOrderCount, SCCs, &r, NULL, NULL); } + q = q_tsi->tsi_suc; } } |