From 4ff3ab1357a8d169379fe41e77ae8ae59a539047 Mon Sep 17 00:00:00 2001 From: alberth Date: Thu, 18 Sep 2014 19:50:41 +0000 Subject: (svn r26848) -Codechange: Unduplicate summing of cargo capacities in GetTotalCapacityOfArticulatedParts. --- src/engine_gui.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/engine_gui.cpp') diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 3ac261d15..0e5324868 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -142,14 +142,8 @@ void ShowEnginePreviewWindow(EngineID engine) */ uint GetTotalCapacityOfArticulatedParts(EngineID engine) { - uint total = 0; - CargoArray cap = GetCapacityOfArticulatedParts(engine); - for (CargoID c = 0; c < NUM_CARGO; c++) { - total += cap[c]; - } - - return total; + return cap.GetSum(); } static StringID GetTrainEngineInfoString(const Engine *e) -- cgit v1.2.3-54-g00ecf