summaryrefslogtreecommitdiff
path: root/lib/rubygems/source/lock.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/source/lock.rb')
-rw-r--r--lib/rubygems/source/lock.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/rubygems/source/lock.rb b/lib/rubygems/source/lock.rb
index 49f097467b..70849210bd 100644
--- a/lib/rubygems/source/lock.rb
+++ b/lib/rubygems/source/lock.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
##
# A Lock source wraps an installed gem's source and sorts before other sources
# during dependency resolution. This allows RubyGems to prefer gems from
@@ -24,13 +25,11 @@ class Gem::Source::Lock < Gem::Source
@wrapped <=> other.wrapped
when Gem::Source then
1
- else
- nil
end
end
def ==(other) # :nodoc:
- 0 == (self <=> other)
+ (self <=> other) == 0
end
def hash # :nodoc: