From 8fb4962407f1fa72fb8c8f7340254e44e97c5efd Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 5 Feb 2009 15:59:23 +0000 Subject: (svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again. --- src/ai/api/ai_vehiclelist.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/ai/api/ai_vehiclelist.cpp') diff --git a/src/ai/api/ai_vehiclelist.cpp b/src/ai/api/ai_vehiclelist.cpp index 1c099910b..a08357b06 100644 --- a/src/ai/api/ai_vehiclelist.cpp +++ b/src/ai/api/ai_vehiclelist.cpp @@ -40,12 +40,7 @@ AIVehicleList_SharedOrders::AIVehicleList_SharedOrders(VehicleID vehicle_id) { if (!AIVehicle::IsValidVehicle(vehicle_id)) return; - Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); - if (v == NULL) { - this->AddItem(vehicle_id); - return; - } - for (; v != NULL; v->NextShared()) { + for (const Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); v != NULL; v->NextShared()) { this->AddItem(v->index); } } -- cgit v1.2.3-54-g00ecf