Skip to content

fix: replace O(n²) string concatenation in readLines with array buffe…

9d91e76
Select commit
Loading
Failed to load commit list.
Closed

fix: replace O(n²) string concatenation in readLines with array buffering #252

fix: replace O(n²) string concatenation in readLines with array buffe…
9d91e76
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 14, 2026 in 9m 8s

Code review found 1 important issue

Found 4 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important js/src/utils.ts:34-38 Missing TextDecoder flush on stream end drops trailing multi-byte characters

Annotations

Check failure on line 38 in js/src/utils.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Missing TextDecoder flush on stream end drops trailing multi-byte characters

The new code never flushes the TextDecoder before breaking on stream end, silently dropping any incomplete multi-byte UTF-8 sequences (e.g. a 4-byte emoji split across the final chunk). Fix: add `const trailing = decoder.decode(); if (trailing) pending.push(trailing)` before the `pending.length` check in the `done` branch.