Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor performance optimizations #2098

Open
821938089 opened this issue Jan 8, 2024 · 2 comments
Open

Minor performance optimizations #2098

821938089 opened this issue Jan 8, 2024 · 2 comments

Comments

@821938089
Copy link

// in HTML, the xmlns attribute if set must match what the parser set the tag's namespace to
if (el.hasAttr("xmlns") && !el.attr("xmlns").equals(el.tag().namespace()))
error("Invalid xmlns attribute [%s] on tag [%s]", el.attr("xmlns"), el.tagName());

el.hasAttr takes a bit of time to execute, which is unnecessary.

@jhy
Copy link
Owner

jhy commented Jan 8, 2024

Cool, can you provide a PR and a benchmark?

@821938089
Copy link
Author

I opened a PR.
#2099

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

No branches or pull requests

2 participants