Merge "Optimise regex pattern compilation in FindProjects"

This commit is contained in:
Conley Owens 2013-05-07 20:08:12 +00:00 committed by Gerrit Code Review
commit 45401230cf

View File

@ -188,9 +188,9 @@ class Command(object):
def FindProjects(self, args):
result = []
patterns = [re.compile(r'%s' % a, re.IGNORECASE) for a in args]
for project in self.GetProjects(''):
for arg in args:
pattern = re.compile(r'%s' % arg, re.IGNORECASE)
for pattern in patterns:
if pattern.search(project.name) or pattern.search(project.relpath):
result.append(project)
break