diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-02-05 11:38:06 -0800 |
|---|---|---|
| committer | Jesse Vincent <jesse@fsck.com> | 2026-02-05 11:38:06 -0800 |
| commit | 038abed0261784d8232712cb329774fda1d4ed29 (patch) | |
| tree | 3b6470a7a067b089f9ff40f705d1111f5c75ccc5 /tests/opencode/setup.sh | |
| parent | 961052e0f9e5528a2f30a4c1086fdf36e835db9b (diff) | |
fix: replace O(n^2) escape_for_json with parameter substitution
The character-by-character loop using ${input:$i:1} was O(n^2) in
bash due to substring copy overhead. On Windows Git Bash this took
60+ seconds, freezing terminal input even with async hooks.
Replaced with bash parameter substitution (${s//old/new}) which runs
each pattern as a single C-level pass. 7x faster on macOS, expected
to be dramatically faster on Windows Git Bash where the original
caused the worst hangs.
Relates to #404, #413
Diffstat (limited to 'tests/opencode/setup.sh')
0 files changed, 0 insertions, 0 deletions
