From 0ae8bcad7320c7dd57a7f081d528af002314fe81 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Mon, 12 Dec 2016 11:44:34 +0000 Subject: [PATCH] [Source::Lock] Avoid hash collisions with un-wrapped sources --- lib/rubygems/source/lock.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rubygems/source/lock.rb b/lib/rubygems/source/lock.rb index 86b16e964c6c..59717be2c0be 100644 --- a/lib/rubygems/source/lock.rb +++ b/lib/rubygems/source/lock.rb @@ -34,6 +34,10 @@ def == other # :nodoc: 0 == (self <=> other) end + def hash # :nodoc: + @wrapped.hash ^ 3 + end + ## # Delegates to the wrapped source's fetch_spec method. @@ -46,4 +50,3 @@ def uri # :nodoc: end end -