File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ class Description
142142 # Fields to exclude when comparing two descriptions.
143143 #
144144 # @since 2.0.6
145- EXCLUDE_FOR_COMPARISON = [ LOCAL_TIME , ELECTION_ID ]
145+ EXCLUDE_FOR_COMPARISON = [ LOCAL_TIME , ELECTION_ID ] . freeze
146146
147147 # @return [ Address ] address The server's address.
148148 attr_reader :address
@@ -553,11 +553,17 @@ def me_mismatch?
553553 def ==( other )
554554 return false if self . class != other . class
555555 return true if config == other . config
556+ compare_config ( other )
557+ end
558+ alias_method :eql? , :==
559+
560+ private
561+
562+ def compare_config ( other )
556563 !config . keys . empty? && config . keys . all? do |k |
557564 config [ k ] == other . config [ k ] || EXCLUDE_FOR_COMPARISON . include? ( k )
558565 end
559566 end
560- alias_method :eql? , :==
561567 end
562568 end
563569end
You can’t perform that action at this time.
0 commit comments