Permalink
Browse files

removed a superfluous if statement from hash_diff

  • Loading branch information...
1 parent 7435dfc commit 2a761e1a2148dcc910b9c9e77ecfaff93af1275d @kirtfitzpatrick kirtfitzpatrick committed Jan 30, 2013
Showing with 8 additions and 10 deletions.
  1. +8 −10 lib/health_inspector/pairing.rb
@@ -60,18 +60,16 @@ def stringify_item(item)
end
def recursive_diff(original, other)
- if original.kind_of?(Hash) && other.kind_of?(Hash)
- (original.keys + other.keys).uniq.inject({}) do |memo, key|
- unless original[key] == other[key]
- if original[key].kind_of?(Hash) && other[key].kind_of?(Hash)
- diff = recursive_diff(original[key], other[key])
- memo[key] = diff unless diff.empty?
- else
- memo[key] = {"server" => original[key], "local" => other[key]}
- end
+ (original.keys + other.keys).uniq.inject({}) do |memo, key|
+ unless original[key] == other[key]
+ if original[key].kind_of?(Hash) && other[key].kind_of?(Hash)
+ diff = recursive_diff(original[key], other[key])
+ memo[key] = diff unless diff.empty?
+ else
+ memo[key] = {"server" => original[key], "local" => other[key]}
end
- memo
end
+ memo
end
end
end

0 comments on commit 2a761e1

Please sign in to comment.