Skip to content

Optimize hash lookup in Enumerable#group_by#14235

Merged
straight-shoota merged 2 commits intocrystal-lang:masterfrom
straight-shoota:refactor/enumerable-group_by
Jan 29, 2024
Merged

Optimize hash lookup in Enumerable#group_by#14235
straight-shoota merged 2 commits intocrystal-lang:masterfrom
straight-shoota:refactor/enumerable-group_by

Conversation

@straight-shoota
Copy link
Member

Using Hash#put_if_absent reduces the number of hash lookups from 2 to 1.

Co-authored-by: Quinton Miller <nicetas.c@gmail.com>
@straight-shoota straight-shoota added this to the 1.12.0 milestone Jan 28, 2024
@straight-shoota straight-shoota merged commit bc0c872 into crystal-lang:master Jan 29, 2024
@straight-shoota straight-shoota deleted the refactor/enumerable-group_by branch January 29, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants