Skip to content

uri: Preinitialize errors array with the correct size in fill_errors()#21560

Merged
TimWolla merged 1 commit intophp:masterfrom
LamentXU123:optimize-4
Mar 28, 2026
Merged

uri: Preinitialize errors array with the correct size in fill_errors()#21560
TimWolla merged 1 commit intophp:masterfrom
LamentXU123:optimize-4

Conversation

@LamentXU123
Copy link
Copy Markdown
Contributor

Since we already could get length from lexbor_plog_length(lexbor_parser.log), we could directly use array_init_size(errors, len) instead of array_init(errors)

@TimWolla TimWolla changed the title /ext/uri/: Slightly optimize fill_errors() uri: Preinitialize errors array with the correct size in fill_errors() Mar 28, 2026
@TimWolla TimWolla merged commit 78f2d44 into php:master Mar 28, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants