From bdb843950abd993cfb8053391faa8f23466f7a2b Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 14 Aug 2006 20:25:29 +0000 Subject: (svn r5894) Remove a totally unnecessary indirection in the vehicle sorter code. Less code, less data, simply better --- train_gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'train_gui.c') diff --git a/train_gui.c b/train_gui.c index 4b6091702..b732e02a7 100644 --- a/train_gui.c +++ b/train_gui.c @@ -1445,7 +1445,7 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e) max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); for (i = w->vscroll.pos; i < max; ++i) { - Vehicle *v = GetVehicle(vl->sort_list[i].index); + const Vehicle* v = vl->sort_list[i]; StringID str; assert(v->type == VEH_Train && v->owner == owner); @@ -1498,7 +1498,7 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e) if (id_v >= vl->list_length) return; // click out of list bound - v = GetVehicle(vl->sort_list[id_v].index); + v = vl->sort_list[id_v]; assert(v->type == VEH_Train && IsFrontEngine(v) && v->owner == owner); -- cgit v1.2.3-54-g00ecf