mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/resolv.rb (Resolv::DNS::Resource#hash): use XOR to accumulate
hash value. * lib/tsort.rb (TSort#each_strongly_connected_component): don't use block argument. (each_strongly_connected_component_from): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3939629ddf
commit
808e9289e6
3 changed files with 34 additions and 7 deletions
|
@ -1272,7 +1272,7 @@ class Resolv
|
|||
def hash
|
||||
h = 0
|
||||
self.instance_variables.each {|name|
|
||||
h += self.instance_eval("#{name}.hash")
|
||||
h ^= self.instance_eval("#{name}.hash")
|
||||
}
|
||||
return h
|
||||
end
|
||||
|
@ -1550,7 +1550,7 @@ class Resolv
|
|||
|
||||
def initialize(address)
|
||||
unless address.kind_of?(String) && address.length == 4
|
||||
raise ArgumentError.new('IPv4 address muse be 4 bytes')
|
||||
raise ArgumentError.new('IPv4 address must be 4 bytes')
|
||||
end
|
||||
@address = address
|
||||
end
|
||||
|
@ -1658,7 +1658,7 @@ class Resolv
|
|||
|
||||
def initialize(address)
|
||||
unless address.kind_of?(String) && address.length == 16
|
||||
raise ArgumentError.new('IPv6 address muse be 16 bytes')
|
||||
raise ArgumentError.new('IPv6 address must be 16 bytes')
|
||||
end
|
||||
@address = address
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue