diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-07 00:36:09 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-07 00:36:09 +0000 |
commit | 05d119620308b71c5a6c17b18e78da9e299a97b4 (patch) | |
tree | eee6c34eb4c3b2ce4384fc1d29e0ba682a4b57e4 /array.c | |
parent | 6271eea522836a6abccd4bbd84ad82576d871716 (diff) | |
download | ruby-05d119620308b71c5a6c17b18e78da9e299a97b4.tar.gz |
* array.c: document that first element is kept when using
Array#uniq and #uniq! [fix GH-845][ci skip]
Patch by @riffraff
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -4181,6 +4181,8 @@ push_value(st_data_t key, st_data_t val, st_data_t ary) * * It compares values using their #hash and #eql? methods for efficiency. * + * +self+ is traversed in order, and the first occurrence is kept. + * * Returns +nil+ if no changes are made (that is, no duplicates are found). * * a = [ "a", "a", "b", "b", "c" ] @@ -4236,6 +4238,8 @@ rb_ary_uniq_bang(VALUE ary) * * It compares values using their #hash and #eql? methods for efficiency. * + * +self+ is traversed in order, and the first occurrence is kept. + * * a = [ "a", "a", "b", "b", "c" ] * a.uniq # => ["a", "b", "c"] * |