Mercurial > hg > svgui
diff view/PaneStack.cpp @ 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 | 4c8ca536b54f |
children | 99373ca20caf 4a578a360011 |
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);