summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-02-04 19:23:10 +0100
committerMichael Schroeder <mls@suse.de>2013-02-04 19:23:10 +0100
commitd8da03ef0940abe3cf91fdeb3a6c172f6cb48e7e (patch)
tree2bee5121e4ac3c31a66b8aaf9f78532118de344d /src
parent460454535325e5b00c78f9f30afa3bc67e3f6038 (diff)
downloadlibsolv-d8da03ef0940abe3cf91fdeb3a6c172f6cb48e7e.tar.gz
libsolv-d8da03ef0940abe3cf91fdeb3a6c172f6cb48e7e.tar.bz2
libsolv-d8da03ef0940abe3cf91fdeb3a6c172f6cb48e7e.zip
optimize code a bit to make analyze_unsolvable faster
Diffstat (limited to 'src')
-rw-r--r--src/rules.c2
-rw-r--r--src/solver.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/rules.c b/src/rules.c
index 11634e9..b0a6f94 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -1841,6 +1841,8 @@ solver_reenablepolicyrules(Solver *solv, int jobidx)
jobtodisablelist(solv, job->elements[jobidx - 1], job->elements[jobidx], &q);
if (!q.count)
return;
+ if (job->count > 64)
+ queue_prealloc(&allq, job->count * 2);
for (i = solv->jobrules; i < solv->jobrules_end; i++)
{
r = solv->rules + i;
diff --git a/src/solver.c b/src/solver.c
index e0ca140..38b53c2 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -965,11 +965,11 @@ solver_reset(Solver *solv)
v = solv->decisionq.elements[i];
solv->decisionmap[v > 0 ? v : -v] = 0;
}
- solv->decisionq_why.count = 0;
- solv->decisionq.count = 0;
+ queue_empty(&solv->decisionq_why);
+ queue_empty(&solv->decisionq);
solv->recommends_index = -1;
solv->propagate_index = 0;
- solv->branches.count = 0;
+ queue_empty(&solv->branches);
/* adapt learnt rule status to new set of enabled/disabled rules */
enabledisablelearntrules(solv);