From 368655c0106b3cd804eb276b9629d39d09df1da6 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 15 Mar 2015 14:15:13 -0700 Subject: [PATCH] Do --max-routes after --prune --- commands/run_cmd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/run_cmd.py b/commands/run_cmd.py index 0f796788..e3a0611a 100644 --- a/commands/run_cmd.py +++ b/commands/run_cmd.py @@ -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: