Skip to content

Commit

Permalink
minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jul 8, 2023
1 parent 0bb86ec commit 2963873
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion care/facility/api/viewsets/prescription.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def sort(self, query, results):
partial_matches = []

for x in results:
if query in f"{x[1]} {x[3]} {x[4]}".lower().split():
words = f"{x[1]} {x[3]} {x[4]}".lower().split()
if query in words:
exact_matches.append(x)
else:
partial_matches.append(x)
Expand Down

0 comments on commit 2963873

Please sign in to comment.