From 2fc6359e2af1349c733481d1c9d5d3c216db004a Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 31 May 2016 21:33:16 +0300 Subject: [PATCH] Micro optimization: break from the loop when the 'id' is encountered --- m_librarian/search.py | 1 + 1 file changed, 1 insertion(+) 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': -- 2.39.5