From a809eec8533d2504d93798f02f6f014195c09f8c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 8 Jan 2016 15:32:42 -0200 Subject: Don't iterate over the dive_table to discover the number of dives dive_table.nr is exactly that. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- desktop-widgets/templatelayout.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp index 59768034e..1c6ca4fba 100644 --- a/desktop-widgets/templatelayout.cpp +++ b/desktop-widgets/templatelayout.cpp @@ -13,12 +13,7 @@ int getTotalWork(print_options *printOptions) // but don't return 0 as we might divide by this number return amount_selected ? amount_selected : 1; } - int dives = 0, i; - struct dive *dive; - for_each_dive (i, dive) { - dives++; - } - return dives; + return dive_table.nr; } void find_all_templates() -- cgit v1.2.3-70-g09d2