From 9261f2e5f700aedcb2228f5c88190cc6f7d666f3 Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 10 May 2021 21:38:20 -0600 Subject: find the needle --- lib/spandx/core/dependency.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spandx/core/dependency.rb b/lib/spandx/core/dependency.rb index 3283f0a..3ae1f10 100644 --- a/lib/spandx/core/dependency.rb +++ b/lib/spandx/core/dependency.rb @@ -33,8 +33,9 @@ module Spandx return 1 if other.nil? score = (name <=> other.name) - score = score&.zero? ? (version <=> other&.version) : score - score&.zero? ? (path.to_s <=> other&.path.to_s) : score + puts [score, name, other.name].inspect if score.nil? + score = score.zero? ? (version <=> other&.version) : score + score.zero? ? (path.to_s <=> other&.path.to_s) : score end def hash -- cgit v1.2.3