From cdff4377724c8368e7a44da18aaf8cbd600f410c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 21 Mar 2011 20:42:37 +0100 Subject: [PATCH] Simplify eta_calc(): let caller compute path length --- src/lib/commands/orde.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/commands/orde.c b/src/lib/commands/orde.c index 145a1f3b..b6f019f0 100644 --- a/src/lib/commands/orde.c +++ b/src/lib/commands/orde.c @@ -285,13 +285,12 @@ orde(void) } static void -eta_calc(struct shpstr *sp, char *path, int *len, int *nupdates) +eta_calc(struct shpstr *sp, int len, int *nupdates) { double mobcost, mobil; int i; - i = strlen(path); - *len = i; + i = len; *nupdates = 1; mobcost = shp_mobcost(sp); @@ -440,7 +439,8 @@ sorde(void) pr(" has arrived"); else { /* distance to destination */ - eta_calc(&ship, c, &len, &updates); + len = strlen(c); + eta_calc(&ship, len, &updates); pr(" %3d %4d", len, updates); } }