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

Add range_qname and range_value methods to Attribute. #120

Merged
merged 2 commits into from
May 23, 2024
Merged

Add range_qname and range_value methods to Attribute. #120

merged 2 commits into from
May 23, 2024

Conversation

Jayonas
Copy link
Contributor

@Jayonas Jayonas commented May 22, 2024

To save memory this only uses a u16 and u8 per Attribute, but the tradeoff is that the qname and value ranges will be incorrect in a few extreme data cases, specifically if the attribute's qname has len > 65535 or there are >254 spaces surrounding its equal sign. Those cases seem unlikely enough in practice to justify not using more memory for this.

To save memory this only uses two `u8`s per `Attribute`, but the tradeoff is that the qname and value ranges will be incorrect in a few extreme data cases, specifically if the attribute's qname has len > 255 or there are >254 spaces surrounding its equal sign.  Those cases seem unlikely enough in practice to justify not using more memory for this.
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/tokenizer.rs Outdated Show resolved Hide resolved
tests/api.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@Jayonas Jayonas changed the title Add positions-extra-attr feature for Attribute subranges. Add range_qname and range_value methods to Attribute. May 22, 2024
@RazrFalcon RazrFalcon merged commit dfed9be into RazrFalcon:master May 23, 2024
2 checks passed
@RazrFalcon
Copy link
Owner

Thanks! Looks good to me. Is that all or do you plan any other changes? If no then I will publish a new release.

@Jayonas Jayonas deleted the attr_subranges branch May 23, 2024 13:09
@Jayonas
Copy link
Contributor Author

Jayonas commented May 23, 2024

Nope, not planning any other changes right now. Thanks!

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.

2 participants