Avoid matching the same warning line twice.
Used to skip only immediately followed identical warning lines.
Now classifywarning is called only once for each unique warning line.
Change-Id: Ie3b77ded70b41dafad91c042dbe15ad2be119e62
Test: run through build.log file
diff --git a/tools/warn.py b/tools/warn.py
index 6324429..c944fb6 100755
--- a/tools/warn.py
+++ b/tools/warn.py
@@ -1977,15 +1977,15 @@
compilepatterns()
# read the log file and classify all the warnings
-lastmatchedline = ''
+warninglines = set()
for line in infile:
# replace fancy quotes with plain ol' quotes
line = line.replace("‘", "'");
line = line.replace("’", "'");
if warningpattern.match(line):
- if line != lastmatchedline:
+ if line not in warninglines:
classifywarning(line)
- lastmatchedline = line
+ warninglines.add(line)
else:
# save a little bit of time by only doing this for the first few lines
if linecounter < 50: