Author: mlschroe Date: Fri Oct 19 18:34:41 2007 New Revision: 7571 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7571&view=rev Log: - do away with complex reenablerule, instead reset propagate_index to 0 and rely on propagate to move the watches Modified: trunk/sat-solver/src/solver.c Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=7571&... ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Fri Oct 19 18:34:41 2007 @@ -1803,54 +1803,6 @@ } -/* - * reenablerule - * - * r->w1 was set to 0, now find proper value for w1. - * solver must be in level 1 for this. - * returns 1 if rule cound be enabled, 0 if current decison - * forbids it. - * - */ - -static void -reenablerule(Solver *solv, Rule *r) -{ - int i; - Id v, l; - - if (!r->w2) /* not a rule, but an assertion */ - { - r->w1 = r->p; - return; - } - if (!r->d) - { - r->w1 = r->p; - return; - } - /* put watch on the first not-false literal */ - for (i = -1; ; i++) - { - if (i == -1) - v = r->p; - else - v = solv->pool->whatprovidesdata[r->d + i]; - if (!v) - { - printrule(solv, r); - abort(); - } - if (v == r->w2) - continue; - l = solv->decisionmap[v > 0 ? v : -v]; - if (!l || (v < 0 && l < 0) || (v > 0 && l > 0)) - break; - } - r->w1 = v; -} - - /*-------------------------------------------------------*/ /* @@ -2221,7 +2173,7 @@ (solv->decisionmap[v] < 0 && r->p > 0)) { printf("direct assertion failure, no solution found!\n"); - for (; i >= 0; i--) + while (--i >= 0) { r = solv->rules + problem[i]; r->w1 = 0; @@ -2230,7 +2182,10 @@ } } } - reenablerule(solv, r); + if (r->d == 0 || r->w2 != r->p) + r->w1 = r->p; + else + r->w1 = solv->pool->whatprovidesdata[r->d]; } reset_solver(solv); for (;;) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org