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,11 +43,10 @@ def binary_search(sorted_collection, item):
current_item = sorted_collection[midpoint]
if current_item == item:
return midpoint
elif item < current_item:
right = midpoint - 1
else:
if item < current_item:
right = midpoint - 1
else:
left = midpoint + 1
left = midpoint + 1
return None