Remove unused visitor helpers#809
Open
nvasilevski wants to merge 1 commit into
Open
Conversation
merge_key was added empty in 2025502 while merge handling remained inline in revive_hash, and it has never been called. dump_list was added empty in 59ecddb while array dumping was implemented inline in visit_array_subclass, and it has never been called. Psych visitor dispatch only targets visit_* methods.
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.
Psych::Visitors::ToRuby#merge_keyandPsych::Visitors::YAMLTree#dump_listare empty private methods with no callers.They are not visitor interface methods: Psych's dispatch paths construct and call only
visit_*methods. Otherdump_*helpers are called explicitly, whiledump_listis not.The history also shows that both methods have been unused since they were added:
merge_keywas added empty in 2025502 while the same change implemented merge handling inline inrevive_hash.dump_listwas added empty in 59ecddb while the same change implemented array dumping inline invisit_array_subclass.This removes both unreachable methods.
Verification:
bundle exec ruby -Itest/lib:test -rhelper test/psych/test_merge_keys.rb— 14 tests, 19 assertions, 0 failuresbundle exec ruby -Itest/lib:test -rhelper test/psych/test_array.rb— 10 tests, 20 assertions, 0 failuresbundle exec ruby -Itest/lib:test -rhelper test/psych/visitors/test_yaml_tree.rb— 31 tests, 129 assertions, 0 failures