From d65b4ba7144540c41c412692c1a2fa99cc3e6bc1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 17 Oct 2011 22:58:04 -0400 Subject: [PATCH] Minor optimization: don't calc if not needed. --- src/ScreenEdit.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 9d5cf5c843..55ae30e77e 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -1496,14 +1496,13 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) // Alt + number = input to right half if( EditIsBeingPressed(EDIT_BUTTON_RIGHT_SIDE) ) ShiftToRightSide( iCol, m_NoteDataEdit.GetNumTracks() ); - + + if( iCol >= m_NoteDataEdit.GetNumTracks() ) + break; // this button is not in the range of columns for this Style const float fSongBeat = GetBeat(); const int iSongIndex = BeatToNoteRow( fSongBeat ); - - if( iCol >= m_NoteDataEdit.GetNumTracks() ) // this button is not in the range of columns for this Style - break; - + // check for to see if the user intended to remove a HoldNote int iHeadRow; if( m_NoteDataEdit.IsHoldNoteAtRow( iCol, iSongIndex, &iHeadRow ) )