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

Simplify Store #1384

Merged
merged 15 commits into from
Nov 23, 2022
Merged

Simplify Store #1384

merged 15 commits into from
Nov 23, 2022

Conversation

hannobraun
Copy link
Owner

Unify the insert and reserve operations into a single code path. This makes the implementation of Store simpler, at the cost of making its use a bit more complicated. I think this is a good trade-off, for two reasons:

  • Most code isn't affected by that, as it's using Store only indirectly through Insert (Make use of Insert trait pervasively #1377 recently completed this migration).
  • The new model provides more flexibility, allowing creation of objects and insertion of them into the store to be completely separate. This is a prerequisite for some changes I'm currently prototyping (sorry, no issue for that yet; I plan to open one within the next few days).

Despite the simplification, we unfortunately end up with more code here, due to lots of repetitive code in the Store wrappers. I believe that the prototyping work I mentioned above will result in those wrappers to become simpler, removing all that repetitive code, so I'm fine with that too.

This doesn't make a difference right now, due to the current usage
patterns. But if those usage patterns were to change, and reserved slots
would no longer be filled immediately, then the iterator would keep
working, thanks to this change.
It's not used currently, and I'm about to replace it with something
simpler.
It's not used there yet, but it will be soon, in a follow-up commit.
This method doesn't make much sense in isolation. This is just me
breaking up what would be a rather large commit into smaller pieces.
@hannobraun hannobraun enabled auto-merge November 23, 2022 14:32
@hannobraun hannobraun merged commit 657b9e8 into main Nov 23, 2022
@hannobraun hannobraun deleted the store branch November 23, 2022 14:36
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.

1 participant