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

Various improvements to Classes, oriented around reducing allocations #2870

Merged
merged 2 commits into from Sep 21, 2022

Commits on Sep 14, 2022

  1. Various improvements to Classes, oriented around reducing allocations

    - `push` no longer performs unnecessary allocations if `self` is empty.
        - Most constructors (FromIterator, From, Extend) are now oriented around push, to take advantage of this
    - `to_string` and `into_prop_value`:
      - No longer allocate an unnecessary `Vec`; they instead preallocate a string of the correct length and push into it directly.
      - No longer use a length check + `unsafe`; they instead match over a fallible .next() and proceed from there.
      - Additionally, `into_prop_value` no longer builds a `String` or `Rc` if `Classes` contains a single `&'static str` or is empty.
    - `From<String>` no longer clones the string if it contains a single class.
    - `impl Eq for Classes`
    Lucretiel committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    4558498 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2022

  1. Configuration menu
    Copy the full SHA
    2016989 View commit details
    Browse the repository at this point in the history