From: Vivien Delmon Date: Wed, 18 May 2011 09:09:07 +0000 (+0200) Subject: Remove strange useless loop X-Git-Tag: v1.2.1~20^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=bfa28052e25a844db48c873254b67a4c56e3a9f9;p=clitk.git Remove strange useless loop - Remove a loop that computes the sum of a list + 1 just after a loop that computes the sum of the same list. --- diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index c82e77f..bb23b79 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -1227,23 +1227,18 @@ void vvMainWindow::ShowHelpDialog() //------------------------------------------------------------------------------ void vvMainWindow::ChangeViewMode() { - QListIterator it0(splitter_3->sizes()); - QListIterator it1(splitter_3->sizes()); - int max0 = 0; - int max1 = 1; - while (it0.hasNext()) { - max0 += it0.next(); - } - while (it1.hasNext()) { - max1 += it1.next(); + QListIterator it(splitter_3->sizes()); + int max_size = 0; + while (it.hasNext()) { + max_size += it.next(); } QList size0; QList size1; if (viewMode == 1) { viewMode = 0; - size0.push_back(max0); + size0.push_back(max_size); size0.push_back(0); - size1.push_back(max1); + size1.push_back(max_size + 1); size1.push_back(0); splitter_3->setSizes(size0); OSplitter->setSizes(size1); @@ -1252,10 +1247,10 @@ void vvMainWindow::ChangeViewMode() DataTree->setColumnHidden(4,1); } else { viewMode = 1; - size0.push_back(int(max0/2)); - size0.push_back(int(max0/2)); - size1.push_back(int(max1/2)); - size1.push_back(int(max1/2)); + size0.push_back(max_size / 2); + size0.push_back(max_size / 2); + size1.push_back((max_size + 1) / 2); + size1.push_back((max_size + 1) / 2); splitter_3->setSizes(size0); OSplitter->setSizes(size1); DataTree->setColumnHidden(2,0);