From a52ccc33c84f6e9872d616c7f223e33ad2a2701f Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 10 Dec 2011 01:41:01 -0500 Subject: [PATCH] Respect optimization opportunity. Considering how often this can be called, it's probably worth the code duplication. --- src/NoteData.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/NoteData.cpp b/src/NoteData.cpp index 3cfbcd239a..96429530a0 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -501,8 +501,13 @@ int NoteData::GetNumTapNotes( int iStartIndex, int iEndIndex ) const int NoteData::GetNumTapNotesInRow( int iRow ) const { - // Optimization opportunity: There's no need to instantiate row iterators if we're only checking one row. - return GetNumTapNotes( iRow, iRow+1 ); + int iNumNotes = 0; + for( int t=0; tIsTap(GetTapNote(t, iRow), iRow)) + iNumNotes++; + } + return iNumNotes; } int NoteData::GetNumRowsWithTap( int iStartIndex, int iEndIndex ) const