Skip to content

Use bytearray for field accumulation in FormParser#3179

Merged
Kludex merged 1 commit intomainfrom
use-bytearray-in-form-parser
Mar 7, 2026
Merged

Use bytearray for field accumulation in FormParser#3179
Kludex merged 1 commit intomainfrom
use-bytearray-in-form-parser

Conversation

@Kludex
Copy link
Copy Markdown
Owner

@Kludex Kludex commented Mar 7, 2026

Summary

  • Replace immutable bytes concatenation (+=) with mutable bytearray.extend() in FormParser.parse() to avoid O(n²) copying when accumulating field names and values.
  • No behavioral or API change - bytearray.decode() produces the same str as bytes.decode().

Replace immutable `bytes` concatenation with mutable `bytearray.extend()`
in `FormParser.parse()` to avoid O(n²) copying when accumulating field
names and values.
@Kludex Kludex force-pushed the use-bytearray-in-form-parser branch from c95b041 to 57242ee Compare March 7, 2026 11:56
@Kludex Kludex merged commit 789b926 into main Mar 7, 2026
7 checks passed
@Kludex Kludex deleted the use-bytearray-in-form-parser branch March 7, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant