Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 8b66e4c

Browse files
committed
Be sure to drop current_sexp from the hashes
It's not always the first in `hashes`, but `current_sexp` uses the first of the sorted array, so dropping that one is safe. Covered by tests here: https://github.com/codeclimate/codeclimate-duplication/blob/master/spec/cc/engine/analyzers/javascript/main_spec.rb#L41-42
1 parent 03ac1bd commit 8b66e4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cc/engine/analyzers/violation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def sorted_hashes
4343
end
4444

4545
def other_sexps
46-
@other_locations ||= hashes.drop(1)
46+
@other_locations ||= sorted_hashes.drop(1)
4747
end
4848

4949
def name

0 commit comments

Comments
 (0)