diff options
author | Tomer Brisker <tbrisker@users.noreply.github.com> | 2020-08-01 00:41:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-01 00:41:43 +0300 |
commit | 5e15415982d38a32f57881a9eac78c670e167a03 (patch) | |
tree | 98fdf76a2c8596d14c3bca79449cc46bb5dec3b6 | |
parent | 181a727c90cb1d320db5821bc16dc0bc34757935 (diff) | |
download | psych-5e15415982d38a32f57881a9eac78c670e167a03.zip |
Remove unneeded assignment and condition
Since we already `return fallback` if `result` is falsy, we don't need to check again if it's truthy and reassign the `to_ruby` result.
-rw-r--r-- | lib/psych.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/psych.rb b/lib/psych.rb index 3fc98db..fcbb056 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -276,8 +276,7 @@ module Psych result = parse(yaml, filename: filename) return fallback unless result - result = result.to_ruby(symbolize_names: symbolize_names, freeze: freeze) if result - result + result.to_ruby(symbolize_names: symbolize_names, freeze: freeze) end ### |