From: Oleg Broytman Date: Tue, 31 May 2016 18:33:16 +0000 (+0300) Subject: Micro optimization: break from the loop when the 'id' is encountered X-Git-Tag: 0.0.11~13 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=2fc6359e2af1349c733481d1c9d5d3c216db004a;p=m_librarian.git Micro optimization: break from the loop when the 'id' is encountered --- diff --git a/m_librarian/search.py b/m_librarian/search.py index 2e761ed..ea292f7 100644 --- a/m_librarian/search.py +++ b/m_librarian/search.py @@ -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':