make code more readable (#1304)

This commit is contained in:
Du YuanChao 2019-10-08 16:22:40 +08:00 committed by Christian Clauss
parent 25701a9877
commit 0da4d0a7f3

View File

@ -43,8 +43,7 @@ def binary_search(sorted_collection, item):
current_item = sorted_collection[midpoint] current_item = sorted_collection[midpoint]
if current_item == item: if current_item == item:
return midpoint return midpoint
else: elif item < current_item:
if item < current_item:
right = midpoint - 1 right = midpoint - 1
else: else:
left = midpoint + 1 left = midpoint + 1