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

Hash#update() vs Hash#[]= #195

Merged

Conversation

manjunath724
Copy link

Hash#update is an alias for Hash#merge!. Ergo, the comparision between Hash#update and Hash#[]= should have similar outcome.

Ref #194


def slow
ENUM.each_with_object({}) do |e, h|
h.update(e => e)
Copy link

@mblumtritt mblumtritt Aug 6, 2021

Choose a reason for hiding this comment

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

Here you create an additional Hash object which of curse will be much slower than only provide two "static" parameters as for Hash#[].

Copy link
Author

Choose a reason for hiding this comment

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

Agree but keeping it similar to its alias Hash#merge!

Copy link
Author

Choose a reason for hiding this comment

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

Can you please guide me, how to go about it?

Copy link

Choose a reason for hiding this comment

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

well it's obviously slower - i guess that's the whole point of this test?
looks fine to me 🌵

Copy link
Author

Choose a reason for hiding this comment

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

Thank you @krtschmr As a next step can the Travis CI build be run for this PR and if everything looks good could this PR be considered for next release?

Copy link

Choose a reason for hiding this comment

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

i have nothing to say here. i feel this repo is a bit inactive 🤷🏿

Copy link
Author

Choose a reason for hiding this comment

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

I understand, can it atleast be merged into the master branch? As its not a breaking change.

@manjunath724
Copy link
Author

Fasterer PR DamirSvrtan/fasterer#92 has a dependency on this one. It would be very helpful if this PR gets merged in. Thanks.

@kindoflew kindoflew merged commit bd5af46 into fastruby:master Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants