diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-12-10 16:08:12 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-12-10 16:08:12 -0500 |
commit | 66953f104ed97b8d7613c25fce3ff8ea246b1707 (patch) | |
tree | 459f162ec52ea7a16ebca0a83c70afd27c2f5896 | |
parent | f35c591f5b5806c15971ff228d4e318c35d7e989 (diff) | |
download | deheader-66953f104ed97b8d7613c25fce3ff8ea246b1707.tar.gz deheader-66953f104ed97b8d7613c25fce3ff8ea246b1707.tar.bz2 deheader-66953f104ed97b8d7613c25fce3ff8ea246b1707.tar.xz deheader-66953f104ed97b8d7613c25fce3ff8ea246b1707.zip |
Defer regexp compilation, we might be able to add missing-require detection.
-rwxr-xr-x | deheader | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -139,7 +139,7 @@ class InclusionMap: print "deheader: %s has requires %s from %s" % (sourcefile, h, r.pattern) requires.append(h) self.depends_on[sourcefile] = includes - self.requires[sourcefile] = re.compile("|".join(requires)) + self.requires[sourcefile] = requires # Duplicate-header detection trimmedcount = {} for ref in map(trim, includes): @@ -231,7 +231,7 @@ def c_analyze(sourcefile, maker, includes, requires, verbosity): baton.twirl() #if requires.pattern: # print "%s: checking %s against %s" % (sourcefile, `header`, `requires.pattern`) - if requires.pattern and requires.search(header): + if requires and re.compile("|".join(requires)).search(header): if verbosity >= PROGRESS_DEBUG: print "deheader: in %s, retaining required %s" % (sourcefile, `header`,) continue |