Open
Conversation
Previously, calling `memoize` with the same method name more than once would result in a perpetual loop when calling that method. This commit fixes the bug. Memoizer now keeps track of which methods have been memoized and avoids trying to memoize an already-memoized method.
This commit changes the implementation of the `memoizer_memoized_methods` variable to use a hash instead of an array so that the lookup is constant time.
Only the patch version has been bumped. Changes since the previous version should be backwards-compatible with all tested versions of ruby. Co-authored-by: Nathan Fixler <nathan.fixler@appfolio.com>
5bee81b to
de5ccae
Compare
|
Why is this stuck? |
|
@fixlr can you see this? |
|
Merging this would also allow for improving the Now that we have an array of memoized methods ( |
AlexWayfer
added a commit
to AlexWayfer/alt_memery
that referenced
this pull request
Mar 14, 2023
|
JFYI, I've added similar spec to my |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the relevant commit: