]> git.phdru.name Git - m_librarian.git/commitdiff
Micro optimization: break from the loop when the 'id' is encountered
authorOleg Broytman <phd@phdru.name>
Tue, 31 May 2016 18:33:16 +0000 (21:33 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 31 May 2016 18:33:16 +0000 (21:33 +0300)
m_librarian/search.py

index 2e761edaf9cbb5b77348dd4828f53b1ac7dfd418..ea292f70d8d379ae9c0ddab6c1d5263328e50274 100644 (file)
@@ -17,6 +17,7 @@ def _mk_search_conditions_with_operator(table, case_sensitive, comparison_op,
     for column, value in values.items():
         if column == 'id':
             _expressions.append(table.q.id == value)
+            break
     if case_sensitive:
         for column, value in values.items():
             if column == 'id':