summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2013-05-07 20:08:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-05-07 20:08:13 +0000
commit45401230cf2b071562617da02ab751468e9aaf8d (patch)
treed4b82c3d033b017a98c00e0129d5563e6031d261 /command.py
parent56f4eea26c703992d0a27fd99b7083593f209677 (diff)
parent84c4d3c345352650fce4dbc2df27c4977f9d969e (diff)
downloadgit-repo-45401230cf2b071562617da02ab751468e9aaf8d.tar.gz
Merge "Optimise regex pattern compilation in FindProjects"
Diffstat (limited to 'command.py')
-rw-r--r--command.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/command.py b/command.py
index 66a9e74d..287f4d30 100644
--- a/command.py
+++ b/command.py
@@ -188,9 +188,9 @@ class Command(object):
188 188
189 def FindProjects(self, args): 189 def FindProjects(self, args):
190 result = [] 190 result = []
191 patterns = [re.compile(r'%s' % a, re.IGNORECASE) for a in args]
191 for project in self.GetProjects(''): 192 for project in self.GetProjects(''):
192 for arg in args: 193 for pattern in patterns:
193 pattern = re.compile(r'%s' % arg, re.IGNORECASE)
194 if pattern.search(project.name) or pattern.search(project.relpath): 194 if pattern.search(project.name) or pattern.search(project.relpath):
195 result.append(project) 195 result.append(project)
196 break 196 break