(svn r792) Small cleanup: Kill a goto
authortron
Wed, 24 Nov 2004 12:47:25 +0000
changeset 499 b224c29812bc
parent 498 1657e9f34c53
child 500 8e52f7797b48
(svn r792) Small cleanup: Kill a goto
economy.c
--- a/economy.c	Wed Nov 24 09:10:42 2004 +0000
+++ b/economy.c	Wed Nov 24 12:47:25 2004 +0000
@@ -1221,9 +1221,8 @@
 
 	st = DEREF_STATION(last_visited = v->last_station_visited);
 
-	for(;;) {
-		if (v->cargo_cap == 0)
-			goto next_vehicle;
+	for (; v != NULL; v = v->next) {
+		if (v->cargo_cap == 0) continue;
 
 		ge = &st->goods[v->cargo_type];
 
@@ -1261,8 +1260,7 @@
 		}
 
 		/* don't pick up goods that we unloaded */
-		if (u->next_order & OF_UNLOAD)
-			goto next_vehicle;
+		if (u->next_order & OF_UNLOAD) continue;
 
 		/* update stats */
 		ge->days_since_pickup = 0;
@@ -1301,10 +1299,6 @@
 			result |= 2;
 			st->last_vehicle = v->index;
 		}
-
-next_vehicle:;
-		if (!(v = v->next))
-			break;
 	}
 
 	v = u;