collection modified in foreach loop
Modifying a collection during a foreach loop caused errors when float imprecision broke binary search matching during object insertion.
- Modifying an array or collection during a foreach loop can trigger collection modified exceptions if callbacks insert new elements
- A helper function used BinarySearch to find existing beat lines and inserted a new line if not found
- Floating-point imprecision from adding and subtracting beat offsets caused binary search to miss existing lines and attempt unwanted inserts
- The issue was fixed by creating a specialized function that directly assigns the line without calling insertion logic


