[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5] Clean up count_implicit_rule_limits()
From: |
Mark Seaborn |
Subject: |
[PATCH 2/5] Clean up count_implicit_rule_limits() |
Date: |
Sun, 25 Feb 2007 18:24:10 +0000 (GMT) |
* Removed unused variable, simplify loop.
* Corrected comment.
---
rule.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/rule.c b/rule.c
index d08383b..a12f9d1 100644
--- a/rule.c
+++ b/rule.c
@@ -61,28 +61,24 @@ unsigned int maxsuffix;
/* Compute the maximum dependency length and maximum number of
dependencies of all implicit rules. Also sets the subdir
- flag for a rule when appropriate, possibly removing the rule
- completely when appropriate. */
+ flag for a rule when appropriate. */
void
count_implicit_rule_limits (void)
{
char *name;
int namelen;
- register struct rule *rule, *lastrule;
+ register struct rule *rule;
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
max_pattern_dep_length = 0;
name = 0;
namelen = 0;
- rule = pattern_rules;
- lastrule = 0;
- while (rule != 0)
+ for (rule = pattern_rules; rule != NULL; rule = rule->next)
{
unsigned int ndeps = 0;
register struct dep *dep;
- struct rule *next = rule->next;
unsigned int ntargets;
++num_pattern_rules;
@@ -142,9 +138,6 @@ count_implicit_rule_limits (void)
if (ndeps > max_pattern_deps)
max_pattern_deps = ndeps;
-
- lastrule = rule;
- rule = next;
}
if (name != 0)
--