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

Add method keys for EnumerableMap #3882

Closed
vlad-khramov opened this issue Dec 16, 2022 · 0 comments · Fixed by #3920
Closed

Add method keys for EnumerableMap #3882

vlad-khramov opened this issue Dec 16, 2022 · 0 comments · Fixed by #3920
Labels
good first issue Low hanging fruit for new contributors to get involved!

Comments

@vlad-khramov
Copy link
Contributor

🧐 Motivation

Add convenient way for retrieving all keys of EnumerableMap. I understand that this method will have limited usage (as EnumerableSet.values())

📝 Details
There are possibilities to get all the keys of EnumerableMap, but they are quite inconvenient. Examles for EnumerableMap.UintToUintMap:

        bytes32[] memory temp = map._inner._keys._inner._values;
        uint256[] memory result;

        assembly {
            result := temp
        }

or

using EnumerableSet for EnumerableSet.Bytes32Set;
...
        bytes32[] memory temp = map._inner._keys.values();
        uint256[] memory result;

        assembly {
            result := temp
        }

or even loop by all keys.

I propose to add method keys with imlementation as in the example 2 above

@Amxx Amxx added the good first issue Low hanging fruit for new contributors to get involved! label Jan 3, 2023
@Amxx Amxx closed this as completed in #3920 Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Low hanging fruit for new contributors to get involved!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants