diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-08 15:32:42 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-08 10:02:35 -0800 |
commit | a809eec8533d2504d93798f02f6f014195c09f8c (patch) | |
tree | bfdeb03af6b385ebf1b31a4b5b2f63ac2f319c0e | |
parent | dec2572ec616fdb2818632a49dcad00447d9c680 (diff) | |
download | subsurface-a809eec8533d2504d93798f02f6f014195c09f8c.tar.gz |
Don't iterate over the dive_table to discover the number of dives
dive_table.nr is exactly that.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | desktop-widgets/templatelayout.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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() |