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

Move from OrderedMap to IndexMap for custom properties #22643

Closed
CYBAI opened this issue Jan 7, 2019 · 2 comments
Closed

Move from OrderedMap to IndexMap for custom properties #22643

CYBAI opened this issue Jan 7, 2019 · 2 comments

Comments

@CYBAI
Copy link
Collaborator

@CYBAI CYBAI commented Jan 7, 2019

After #22555 merged, we've introduced the indexmap crate.
There's a similar implementation in custom properies called OrderedMap.

/// A map that preserves order for the keys, and that is easily indexable.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct OrderedMap<K, V>
where
K: PrecomputedHash + Hash + Eq + Clone,
{
/// Key index.
index: Vec<K>,
/// Key-value map.
values: PrecomputedHashMap<K, V>,
}

It would be great to reuse the indexmap crate and remove the OrderedMap instead.

cc @emilio

@CYBAI CYBAI added the I-refactor label Jan 7, 2019
@shanavas786
Copy link
Contributor

@shanavas786 shanavas786 commented Jan 9, 2019

@highfive assign me

@highfive highfive added the C-assigned label Jan 9, 2019
@highfive
Copy link

@highfive highfive commented Jan 9, 2019

Hey @shanavas786! Thanks for your interest in working on this issue. It's now assigned to you!

@shanavas786 shanavas786 mentioned this issue Jan 9, 2019
3 of 4 tasks complete
bors-servo added a commit that referenced this issue Jan 10, 2019
Remove OrderedMap in favor of IndexMap

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22643

<!-- Either: -->
- [x] These changes do not require tests because its just refactoring

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22656)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.