Skip to content

Commit

Permalink
Merge pull request robcarver17#179 from tgibson11/patch-26
Browse files Browse the repository at this point in the history
Fixed index out of bounds error
  • Loading branch information
robcarver17 authored Jun 10, 2020
2 parents 986273c + a3fdeee commit 3291c01
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions sysdata/production/current_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,11 @@ def index(self, tradeable_object, start = 0, stop = None):
if stop is None:
stop = len(self)-1

not_found = True
idx=start
while not_found:
while idx <= stop:
position_to_check = self[idx]
if position_to_check.tradeable_object == tradeable_object:
return idx
if idx>= stop:
break

idx = idx+1

Expand Down

0 comments on commit 3291c01

Please sign in to comment.