зеркало из https://github.com/github/ruby.git
* array.c: Improve documentation about
comparison by hash for concerned methods. [ruby-core:51266] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
18a8812e36
Коммит
d5b7fc432f
|
@ -1,3 +1,8 @@
|
|||
Tue Jan 29 19:27:18 2013 Benoit Daloze <eregontp@gmail.com>
|
||||
|
||||
* array.c: Improve documentation about
|
||||
comparison by hash for concerned methods. [ruby-core:51266]
|
||||
|
||||
Tue Jan 29 17:03:28 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_backtrace.c: fix issue of rb_debug_inspector_open().
|
||||
|
|
11
array.c
11
array.c
|
@ -3800,7 +3800,7 @@ ary_recycle_hash(VALUE hash)
|
|||
* Returns a new array that is a copy of the original array, removing any
|
||||
* items that also appear in +other_ary+.
|
||||
*
|
||||
* It compares elements using their hash (returned by the Object#hash method).
|
||||
* It compares elements using their #hash and #eql? methods for efficiency.
|
||||
*
|
||||
* [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
|
||||
*
|
||||
|
@ -3832,6 +3832,8 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
|
|||
* Set Intersection --- Returns a new array containing elements common to the
|
||||
* two arrays, excluding any duplicates.
|
||||
*
|
||||
* It compares elements using their #hash and #eql? methods for efficiency.
|
||||
*
|
||||
* [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
|
||||
* [ 'a', 'b', 'b', 'z' ] & [ 'a', 'b', 'c' ] #=> [ 'a', 'b' ]
|
||||
*
|
||||
|
@ -3872,6 +3874,8 @@ rb_ary_and(VALUE ary1, VALUE ary2)
|
|||
* Set Union --- Returns a new array by joining +ary+ with +other_ary+,
|
||||
* excluding any duplicates.
|
||||
*
|
||||
* It compares elements using their #hash and #eql? methods for efficiency.
|
||||
*
|
||||
* [ "a", "b", "c" ] | [ "c", "d", "a" ] #=> [ "a", "b", "c", "d" ]
|
||||
*
|
||||
* See also Array#uniq.
|
||||
|
@ -3921,6 +3925,8 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
|
|||
* If a block is given, it will use the return value of the block for
|
||||
* comparison.
|
||||
*
|
||||
* It compares values using their #hash and #eql? methods for efficiency.
|
||||
*
|
||||
* Returns +nil+ if no changes are made (that is, no duplicates are found).
|
||||
*
|
||||
* a = [ "a", "a", "b", "b", "c" ]
|
||||
|
@ -3983,8 +3989,7 @@ rb_ary_uniq_bang(VALUE ary)
|
|||
*
|
||||
* If a block is given, it will use the return value of the block for comparison.
|
||||
*
|
||||
* It compares elements using their hash (provided by the Object#hash method)
|
||||
* then compares hashes with Object#eql?.
|
||||
* It compares values using their #hash and #eql? methods for efficiency.
|
||||
*
|
||||
* a = [ "a", "a", "b", "b", "c" ]
|
||||
* a.uniq # => ["a", "b", "c"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче