validate_failures.py: Fix performance regression
authoraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Feb 2013 16:55:35 +0000 (16:55 +0000)
committeraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Feb 2013 16:55:35 +0000 (16:55 +0000)
2013-02-06  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

* testsuite-management/validate_failures.py
(IsInterestingResult): Fix performance regression

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195811 138bc75d-0d04-0410-961f-82ee72b054a4

contrib/ChangeLog
contrib/testsuite-management/validate_failures.py

index eaccdbd..0ace63e 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-06  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+       * testsuite-management/validate_failures.py
+       (IsInterestingResult): Fix performance regression
+
 2013-02-04  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * update-copyright.py: New file.
index ec51de9..5c80ca3 100755 (executable)
@@ -62,6 +62,7 @@ import sys
 
 # Handled test results.
 _VALID_TEST_RESULTS = [ 'FAIL', 'UNRESOLVED', 'XPASS', 'ERROR' ]
+_VALID_TEST_RESULTS_REX = re.compile("%s" % "|".join(_VALID_TEST_RESULTS))
 
 # Subdirectory of srcdir in which to find the manifest file.
 _MANIFEST_SUBDIR = 'contrib/testsuite-management'
@@ -210,7 +211,7 @@ def IsInterestingResult(line):
   if '|' in line:
     (_, line) = line.split('|', 1)
     line = line.strip()
-  return any(line.startswith(result) for result in _VALID_TEST_RESULTS)
+  return bool(_VALID_TEST_RESULTS_REX.match(line))
 
 
 def IsInclude(line):