Skip to content

Don't allocate AttributesCollection in HtmlNode unless needed#558

Merged
JonathanMagnan merged 1 commit intozzzprojects:masterfrom
lahma:dont-allocate-in-getid
Sep 17, 2025
Merged

Don't allocate AttributesCollection in HtmlNode unless needed#558
JonathanMagnan merged 1 commit intozzzprojects:masterfrom
lahma:dont-allocate-in-getid

Conversation

@lahma
Copy link
Contributor

@lahma lahma commented Jun 29, 2024

Calling HtmlNode.GetId and others can cause attribute collection construction, changing to check whether there are attributes before accessing the allocating Attributes getter.

@lahma lahma force-pushed the dont-allocate-in-getid branch 2 times, most recently from d5c0caf to 235be93 Compare June 29, 2024 09:41
@lahma lahma changed the title Don't allocate AttributesCollection in HtmlNode.GetId unless needed Don't allocate AttributesCollection in HtmlNode unless needed Jun 29, 2024
@lahma lahma force-pushed the dont-allocate-in-getid branch from 235be93 to e29f7af Compare September 16, 2025 04:10
@JonathanMagnan
Copy link
Member

Hello @lahma ,

Thank you for your contribution ;) Sorry for having taking so long to merge your pull.

Best Regards,

Jon

@JonathanMagnan JonathanMagnan merged commit 9758885 into zzzprojects:master Sep 17, 2025
@JonathanMagnan JonathanMagnan self-assigned this Sep 17, 2025
@lahma lahma deleted the dont-allocate-in-getid branch September 17, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants