From 406ab5403187a97c2cfd48c56f1316dac2170abb Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Mon, 21 Apr 2008 18:55:48 +0000 Subject: [PATCH] Lets not use `goto` when a simple `return` suffices git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4737 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/fpath.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/fpath.c b/src/fpath.c index 72056491f..ddf460151 100644 --- a/src/fpath.c +++ b/src/fpath.c @@ -462,8 +462,7 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s { // routing hasn't finished yet objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Reschedule"); - retval = FPR_WAIT; - goto exit; + return FPR_WAIT; } routeMode = ASR_NEWROUTE; @@ -472,8 +471,7 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s { // found a blocking wall - route to that objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Got blocking wall"); - retval = FPR_OK; - goto exit; + return FPR_OK; } else if (asret == ASR_NEAREST) { @@ -484,15 +482,13 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s psMoveCntl->numPoints = 0; fpathAppendRoute(psMoveCntl, &sAStarRoute); } - retval = FPR_OK; - goto exit; + return FPR_OK; } else if (asret == ASR_FAILED) { // all routing was in one zone - can't retry objTrace(LOG_MOVEMENT, psDroid->id, "fpathGatewayRoute: Failed route in same zone"); - retval = FPR_FAILED; - goto exit; + return FPR_FAILED; } linkx = gwx; @@ -508,8 +504,6 @@ static FPATH_RETVAL fpathGatewayRoute(DROID* psDroid, SDWORD routeMode, SDWORD s fpathAppendRoute(psMoveCntl, &sAStarRoute); } -exit: - return retval; }