Skip to content

Commit

Permalink
arr[end] was excluded when end is not None
Browse files Browse the repository at this point in the history
  • Loading branch information
royf committed Apr 21, 2018
1 parent 8264e64 commit 4e7129b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/ray/rllib/optimizers/segment_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ def reduce(self, start=0, end=None):
elements.
"""
if end is None:
end = self._capacity
end = self._capacity - 1
if end < 0:
end += self._capacity
end -= 1
return self._reduce_helper(start, end, 1, 0, self._capacity - 1)

def __setitem__(self, idx, val):
Expand Down

0 comments on commit 4e7129b

Please sign in to comment.