From 8660890bbb82638dcb81f713047aa3e16ad82cf4 Mon Sep 17 00:00:00 2001 From: terkhen Date: Fri, 2 Apr 2010 12:20:41 +0000 Subject: (svn r19539) -Codechange: Use a macro to loop through the list of sorted cargo specifications. --- src/build_vehicle_gui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/build_vehicle_gui.cpp') diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index e4cfba54d..351941838 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -853,9 +853,10 @@ struct BuildVehicleWindow : Window { } /* Collect available cargo types for filtering. */ - for (int i = 0; i < _sorted_cargo_specs_size; i++) { - this->cargo_filter[filter_items] = _sorted_cargo_specs[i]->Index(); - this->cargo_filter_texts[filter_items] = _sorted_cargo_specs[i]->name; + const CargoSpec *cs; + FOR_ALL_SORTED_CARGOSPECS(cs) { + this->cargo_filter[filter_items] = cs->Index(); + this->cargo_filter_texts[filter_items] = cs->name; filter_items++; } -- cgit v1.2.3-70-g09d2