A static extension which provides utility functions for Array<SongNoteData>s.
Static methods
staticfastIndexOf(input:Array<SongNoteData>, note:SongNoteData):Int
Queries whether the provided SongNoteData is contained in the provided array.
The input array must be already sorted by time.
Vastly more efficient than array.indexOf.
This is not crazy or premature optimization, I'm writing this because ChartEditorState.handleNoteDisplay is using like 71% of its CPU time on this.
Parameters:
arr | The array to search. |
|---|---|
note | The note to search for. |
predicate |
Returns:
The index of the note in the array, or -1 if it is not present.