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

Optimize map traversals #168

Open
vtereshkov opened this issue Jun 26, 2022 · 0 comments
Open

Optimize map traversals #168

vtereshkov opened this issue Jun 26, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@vtereshkov
Copy link
Owner

The for...in loop, when applied to maps, now calls the keys() function, then iterates over the key array and requests the map item for each key individually. The repr() function is implemented in a similar fashion. Thus, the map tree is traversed twice: first when constructing the key array, then for accessing the map items. In theory, a single traversal is enough to get both the keys and the items.

@vtereshkov vtereshkov added the enhancement New feature or request label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant