mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOC] Tweaks for Array#hash (#11704)
This commit is contained in:
parent
5be11c1d1b
commit
03ca99c93b
1 changed files with 6 additions and 4 deletions
10
array.c
10
array.c
|
@ -5275,14 +5275,16 @@ rb_ary_hash_values(long len, const VALUE *elements)
|
|||
|
||||
/*
|
||||
* call-seq:
|
||||
* array.hash -> integer
|
||||
* hash -> integer
|
||||
*
|
||||
* Returns the integer hash value for +self+.
|
||||
*
|
||||
* Two arrays with the same content will have the same hash code (and will compare using #eql?):
|
||||
* Two arrays with the same content will have the same hash value
|
||||
* (and will compare using eql?):
|
||||
*
|
||||
* [0, 1, 2].hash == [0, 1, 2].hash # => true
|
||||
* [0, 1, 2].hash == [0, 1, 3].hash # => false
|
||||
* ['a', 'b'].hash == ['a', 'b'].hash # => true
|
||||
* ['a', 'b'].hash == ['a', 'c'].hash # => false
|
||||
* ['a', 'b'].hash == ['a'].hash # => false
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue