diff options
| author | Conley Owens <cco3@android.com> | 2013-05-07 20:08:12 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-05-07 20:08:13 +0000 |
| commit | 45401230cf2b071562617da02ab751468e9aaf8d (patch) | |
| tree | d4b82c3d033b017a98c00e0129d5563e6031d261 /command.py | |
| parent | 56f4eea26c703992d0a27fd99b7083593f209677 (diff) | |
| parent | 84c4d3c345352650fce4dbc2df27c4977f9d969e (diff) | |
| download | git-repo-45401230cf2b071562617da02ab751468e9aaf8d.tar.gz | |
Merge "Optimise regex pattern compilation in FindProjects"
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -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 |
