Commit 21e7353
authored
Fix stale strong beats persisting in beatList across meter changes (#5730)
* Fix stale strong beats persisting in beatList across meter changes
setMeter() pushed default strong beats without clearing previous
entries, causing incorrect beat events after a mid-piece meter change.
Signed-off-by: Ady0333 <adityashinde1525@gmail.com>
* Refactor: extract _clearDefaultStrongBeats helper using Array.filter()
Replace duplicated splice-in-loop cleanup logic in setMeter() and
onStrongBeatDo() with a shared _clearDefaultStrongBeats() helper that
uses Array.filter() to rebuild beatList without mutation during iteration.
Behavior is preserved exactly: only numeric default strong beats are
removed; user-defined "everybeat" and "offbeat" entries are kept.
* chore(lint): fix ESLint violations
---------
Signed-off-by: Ady0333 <adityashinde1525@gmail.com>1 parent 0019021 commit 21e7353
1 file changed
+21
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
| |||
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
| |||
255 | 274 | | |
256 | 275 | | |
257 | 276 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 277 | + | |
| 278 | + | |
271 | 279 | | |
272 | 280 | | |
273 | 281 | | |
| |||
0 commit comments