[DOC] Tweaks for Array#hash (#11704)

This commit is contained in:
Burdette Lamar 2024-09-29 20:22:43 -05:00 committed by GitHub
parent 5be11c1d1b
commit 03ca99c93b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
array.c
View File

@ -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
*
*/