Respect optimization opportunity.

Considering how often this can be called,
it's probably worth the code duplication.
This commit is contained in:
Jason Felds
2011-12-10 01:41:01 -05:00
parent 6d1517c9ce
commit a52ccc33c8
+7 -2
View File
@@ -501,8 +501,13 @@ int NoteData::GetNumTapNotes( int iStartIndex, int iEndIndex ) const
int NoteData::GetNumTapNotesInRow( int iRow ) const int NoteData::GetNumTapNotesInRow( int iRow ) const
{ {
// Optimization opportunity: There's no need to instantiate row iterators if we're only checking one row. int iNumNotes = 0;
return GetNumTapNotes( iRow, iRow+1 ); for( int t=0; t<GetNumTracks(); t++ )
{
if (this->IsTap(GetTapNote(t, iRow), iRow))
iNumNotes++;
}
return iNumNotes;
} }
int NoteData::GetNumRowsWithTap( int iStartIndex, int iEndIndex ) const int NoteData::GetNumRowsWithTap( int iStartIndex, int iEndIndex ) const