aboutsummaryrefslogtreecommitdiffstats
path: root/lib/set.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/set.rb')
-rwxr-xr-x[-rw-r--r--]lib/set.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 5e4e0878bd..5655c263ba 100644..100755
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -130,8 +130,8 @@ class Set
# Replaces the contents of the set with the contents of the given
# enumerable object and returns self.
def replace(enum)
- if enum.class == self.class
- @hash.replace(enum.instance_eval { @hash })
+ if enum.instance_of?(self.class)
+ @hash.replace(enum.instance_variable_get(:@hash))
else
clear
merge(enum)