Skip to content

Commit

Permalink
Do --max-routes after --prune
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Mar 15, 2015
1 parent c1fec63 commit 368655c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,14 +1021,14 @@ def run(results, cmdenv, tdb):

if hopNo >= 1 and cmdenv.maxRoutes or pruneMod:
routes.sort()
if cmdenv.maxRoutes:
routes = routes[:cmdenv.maxRoutes]

if pruneMod and hopNo + 1 >= cmdenv.pruneHops and len(routes) > 10:
crop = int(len(routes) * pruneMod)
routes = routes[:-crop]
cmdenv.NOTE("Pruned {} origins", crop)

if cmdenv.maxRoutes and len(routes) > cmdenv.maxRoutes:
routes = routes[:cmdenv.maxRoutes]

if cmdenv.progress:
print("* Hop {:3n}: {:.>10n} origins".format(hopNo+1, len(routes)))
elif cmdenv.debug:
Expand Down

0 comments on commit 368655c

Please sign in to comment.