Skip to content

Commit

Permalink
Merge pull request #501 from Deborah-Digges/remove-from-loop
Browse files Browse the repository at this point in the history
Remove string join operation from loop to improve performance
  • Loading branch information
ethanwhite committed Jun 6, 2016
2 parents e3600c1 + e291211 commit 1592c96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ def exists(self, engine=None):

def matches_terms(self, terms):
try:
for term in terms:
search_string = ' '.join([
search_string = ' '.join([
self.name,
self.description,
self.shortname
] + self.tags).upper()
] + self.tags).upper()

for term in terms:
if not term.upper() in search_string:
return False
return True
Expand Down

0 comments on commit 1592c96

Please sign in to comment.