Skip to content

Commit

Permalink
Fix for off-by-one error with jumps-per
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 16, 2014
1 parent 08d3034 commit a6e9262
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ def getDestinations(self, maxJumps=None, maxLy=None, maxLyPer=None):
maxJumpDist = float(maxLyPer or sys.maxint)
while not openList.empty():
(sys, jumps, dist) = openList.get()
if maxJumps and len(jumps) - 1 > maxJumps:
if maxJumps and len(jumps) > maxJumps:
continue
if maxLy and dist > maxLy:
continue
jumps = list(jumps + [sys])
for stn in sys.stations:
if stn != self:
destStations.append([sys, stn, jumps, dist])
if (maxJumps and len(jumps) >= maxJumps):
if (maxJumps and len(jumps) > maxJumps):
continue
for (destSys, destDist) in sys.links.items():
if destDist > maxJumpDist:
Expand Down

0 comments on commit a6e9262

Please sign in to comment.