Skip to content

Commit

Permalink
Fix existing offenses for Security/CompoundHash
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Seaton <chris.seaton@shopify.com>
  • Loading branch information
2 people authored and bbatsov committed Apr 9, 2022
1 parent 697dee2 commit 3426137
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/offense.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def ==(other)
alias eql? ==

def hash
COMPARISON_ATTRIBUTES.reduce(0) { |hash, attribute| hash ^ public_send(attribute).hash }
COMPARISON_ATTRIBUTES.map { |attribute| public_send(attribute) }.hash
end

# @api public
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/variable_force/branch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def ==(other)
alias_method :eql?, :==

def hash
control_node.object_id.hash ^ child_node.object_id.hash
[control_node.object_id, control_node.object_id].hash
end

private
Expand Down

0 comments on commit 3426137

Please sign in to comment.