Skip to content

Commit

Permalink
Added includeSelf flag to genSystemsInRange
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Nov 3, 2014
1 parent cce3309 commit fff2ccd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def lookupSystemRelaxed(self, key):
return system


def genSystemsInRange(self, system, ly):
def genSystemsInRange(self, system, ly, includeSelf=False):
"""
Generator for systems within ly range of system using a
lazily-populated, per-system cache.
Expand All @@ -542,6 +542,9 @@ def genSystemsInRange(self, system, ly):

# Yield what we already have
system = self.lookupSystem(system)
if includeSelf:
yield system, 0.

cache = system._rangeCache
if not cache:
cache = system._rangeCache = System.RangeCache()
Expand Down

0 comments on commit fff2ccd

Please sign in to comment.