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 Set and SetMultimap to use Map2 internally and match new conventions #1524

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

anorth
Copy link
Member

@anorth anorth commented Feb 29, 2024

Re #1346

@anorth anorth requested a review from rvagg February 29, 2024 20:11
@anorth anorth changed the title Update SetMultimap to use Map2 internally and match conventions Update Set and SetMultimap to use Map2 internally and match conventions Feb 29, 2024
@anorth anorth changed the title Update Set and SetMultimap to use Map2 internally and match conventions Update Set and SetMultimap to use Map2 internally and match new conventions Feb 29, 2024
Comment on lines -137 to -143
deal_ops
.0
.for_each(|key, _| {
let epoch = parse_uint_key(key).unwrap() as i64;

deal_ops
.for_each(epoch, |ref deal_id| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice change, I had to dig into the code to confirm what this original form was doing. Just to confirm though, what we're doing is: "iterate over the raw keys of the outer hamt, then use those keys to iterate over the inner hamt to look at its values". But in the new form, for_each gives us the former and for_each_in gives us the latter.

@anorth
Copy link
Member Author

anorth commented Feb 29, 2024

Thanks for the suggestions, @rvagg. I rewrote some of the comments more fully, and deleted some that are now low value.

@Stebalien
Copy link
Member

I played around with this a bit and I think we can get rid of the clone: #1525

(although I'm not sure if that'll work in all cases?)

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 and with #1525 which seems to pass

@anorth anorth enabled auto-merge March 1, 2024 04:03
@anorth anorth added this pull request to the merge queue Mar 1, 2024
Merged via the queue into master with commit 8324a49 Mar 1, 2024
14 checks passed
@anorth anorth deleted the anorth/multimap2 branch March 1, 2024 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

3 participants