changeset 855:57efeb75880d

Simplify some logic where loop was used with an unconditional "break" that meant it could only happen once (from coverity scan)
author Chris Cannam
date Wed, 03 Sep 2014 12:05:45 +0100
parents c17719e488c9
children ee36642b9b59
files view/PaneStack.cpp
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/view/PaneStack.cpp	Wed Sep 03 12:04:22 2014 +0100
+++ b/view/PaneStack.cpp	Wed Sep 03 12:05:45 2014 +0100
@@ -99,10 +99,8 @@
     currentIndicator->setVisible(m_showAccessories);
 
     int initialCentreFrame = -1;
-    for (int i = 0; i < (int)m_panes.size(); ++i) {
-        int f = m_panes[i].pane->getCentreFrame();
-        initialCentreFrame = f;
-        break;
+    if (!m_panes.empty()) {
+        initialCentreFrame = m_panes[0].pane->getCentreFrame();
     }
 
     Pane *pane = new Pane(frame);