Stop retaining the unused original options hash - #27
Open
OskarEichler wants to merge 1 commit into
Open
Conversation
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.
Summary
Remove the unused
@staticreference inUber::Options#initialize. Since 0.1.0, every entry is already wrapped and stored in the Options hash; nothing reads@static. Retaining the caller's entire original Hash is unnecessary and can keep subsequently removed entries alive.Reproduction
Original:
true,[:payload]. Fixed:false,[:payload]. Required wrapped values remain reachable, while the original input Hash can be collected.Verification
bundle exec rake test, 45 tests / 50 assertions, zero failures/errors/skips on Ruby 4.0.6 / Minitest 4.7.5.Compatibility / limitations
No documented API breaking change intended. The undocumented, unused
@staticinstance variable no longer exists; reflective code relying on it would be affected. This deliberately does not deep-copy or change the wrapped values or result Hash behavior. The older #17 static-result aliasing proposal addresses a different, superseded implementation.No new/modified checked-in tests. Ruby 1.9.3–3.1, JRuby, Windows and Linux were not run locally. Collection evidence is from CRuby WeakRef/GC checks; no production memory-size or throughput claim.