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

Update docs of set_if_neq and replace_if_neq #12919

Merged
merged 4 commits into from
Apr 15, 2024

Commits on Apr 10, 2024

  1. add more flexible version of set_if_neq

    In one of my personal projects I stumbled across a case where I wanted
    to be cautious with the change detection while also not sacraficing any
    performance.
    
    My use case: I basically have a horizontal surface which is saved as a
    collection of `Vec<Vec2>` in a component. The component also includes a
    height field. Now when the height is updated there only have two (three)
    options:
    
    - The collection of points can be cloned so the existing `set_if_neq` is
      usable
    - The `set_if_neq` code can be inlined and adjusted for this special case
    - (The component can be split up into two more granular components)
    
    I have to acknowledge that the third point here is probably the way to
    go in most cases, but I was curious:
    
    - if it would be possible to have a more flexible API and how that would
      look like
    - if you are interested in this change in general
    
    No hard feelings if we just end up rejecting this PR. I'm also totally
    fine with this. But maybe it's useful to anyone and I just wanted to
    hear your feedback first before tossing this back into the void and
    forgetting about it.
    RobWalt committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    71b90f5 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Revert "add more flexible version of set_if_neq"

    This reverts commit 71b90f5.
    RobWalt committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    0d200db View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    54ceeca View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

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