Author: mlschroe Date: Mon Oct 22 12:19:55 2007 New Revision: 7593 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7593&view=rev Log: - beautify a bit 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=7593&r1=7592&r2=7593&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Mon Oct 22 12:19:55 2007 @@ -560,8 +560,8 @@ static Rule * addrule(Solver *solv, Id p, Id d) { - Rule *r = NULL; - Id *dp = NULL; + Rule *r = 0; + Id *dp = 0; int n = 0; /* number of literals in rule - 1 0 = direct assertion (single literal) @@ -582,7 +582,7 @@ if (d < 0) { if (p == d) - return NULL; /* ignore self conflict */ + return 0; /* ignore self conflict */ n = 1; } else if (d == 0) /* user requested */ @@ -591,7 +591,7 @@ { for (dp = solv->pool->whatprovidesdata + d; *dp; dp++, n++) if (*dp == -p) - return NULL; /* rule is self-fulfilling */ + return 0; /* rule is self-fulfilling */ if (n == 1) d = dp[-1]; } @@ -611,7 +611,7 @@ queuepush(&solv->decisionq, p); queuepush(&solv->decisionq_why, 0); solv->decisionmap[-p] = -1; - return NULL; + return 0; } } else if (n == 1 && p > d) @@ -623,28 +623,19 @@ n = 1; /* re-set n, was used as temp var */ } - /* check if the last added rule is exactly the same as what we're looking for. - * Differ between binary rules and non-binary rules with one literal (e.g. two kernels) */ - if (r - && n == 1 - && r->p == p - && ( ( !r->d && r->w2 == d ) - || r->d == d)) - { + /* check if the last added rule is exactly the same as what we're looking for. */ + if (r && n == 1 && !r->d && r->p == p && r->w2 == d) return r; - } - if (r - && r->d - && n > 1 - && r->p == p) + if (r && n > 1 && r->d && r->p == p) { - Id *dp2 = solv->pool->whatprovidesdata + r->d; + Id *dp2; + if (d == r->d) + return r; + dp2 = solv->pool->whatprovidesdata + r->d; for (dp = solv->pool->whatprovidesdata + d; *dp; dp++, dp2++) - { if (*dp != *dp2) break; - } if (*dp == *dp2) return r; } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org