( history: NoteJumpLocation[], location: NoteJumpLocation | null )
| 1331 | } |
| 1332 | |
| 1333 | function appendNoteJumpHistory( |
| 1334 | history: NoteJumpLocation[], |
| 1335 | location: NoteJumpLocation | null |
| 1336 | ): NoteJumpLocation[] { |
| 1337 | if (!location) return history |
| 1338 | if (sameNoteJumpLocation(history[history.length - 1] ?? null, location)) return history |
| 1339 | const next = [...history, location] |
| 1340 | return next.length > MAX_NOTE_JUMP_HISTORY |
| 1341 | ? next.slice(next.length - MAX_NOTE_JUMP_HISTORY) |
| 1342 | : next |
| 1343 | } |
| 1344 | |
| 1345 | function rewriteNoteJumpHistory( |
| 1346 | history: NoteJumpLocation[], |
no test coverage detected