summaryrefslogtreecommitdiff
path: root/aircraft_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-08-14 20:25:29 +0000
committertron <tron@openttd.org>2006-08-14 20:25:29 +0000
commitbdb843950abd993cfb8053391faa8f23466f7a2b (patch)
tree22316d8ec4aa0a3bc1a32f91568adc623e6c4b9a /aircraft_gui.c
parent4382cd6b912cba9b72d126c3e63eb2c0d3d00119 (diff)
downloadopenttd-bdb843950abd993cfb8053391faa8f23466f7a2b.tar.xz
(svn r5894) Remove a totally unnecessary indirection in the vehicle sorter code. Less code, less data, simply better
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r--aircraft_gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 72b05f018..72784b99e 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -1047,7 +1047,7 @@ static void PlayerAircraftWndProc(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_Aircraft && v->subtype <= 2);
@@ -1101,7 +1101,7 @@ static void PlayerAircraftWndProc(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_Aircraft && v->subtype <= 2);