Sha256: 39de6433ebcd3301e9b9e65dac7c6dba15719c878b3e72cb6b072c0a68441bc2

Contents?: true

Size: 1.8 KB

Versions: 12

Compression:

Stored size: 1.8 KB

Contents

o:$YARD::CodeObjects::MethodObject:
@name:-:@docstringIC:YARD::Docstring"ûArray Difference---Returns a new array that is a copy of
the original array, removing any items that also appear in
other_array. (If you need set-like behavior, see the
library class Set.)

   [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ]  #=>  [ 3, 3, 5 ]
:@objectu:YARD::StubProxyArray#-:
@summary0:	@all"(Array Difference---Returns a new array that is a copy of
the original array, removing any items that also appear in
other_array. (If you need set-like behavior, see the
library class Set.)

   [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ]  #=>  [ 3, 3, 5 ]


@overload -(other_array)
  @return [Array]:@ref_tags[:
@tags[o:YARD::Tags::OverloadTag
;
u;Array#-;;;IC;	"
;
u;Array#-;0;
"@return [Array];[;[o:YARD::Tags::Tag
;
0;0:@types["
Array:
@text":@tag_name"return;0:@parameters[[:other_array0;0:@signature"-(other_array);"
overload:@current_file_has_commentsF:@scope:
instance;[:@docstring_extra0:@files[["array.c0:@namespaceu;
Array:
@path"Array#-;[:@visibility:public:@source"Ä/* 
 *  call-seq:
 *     array - other_array    -> an_array
 *
 *  Array Difference---Returns a new array that is a copy of
 *  the original array, removing any items that also appear in
 *  other_array. (If you need set-like behavior, see the
 *  library class Set.)
 *
 *     [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ]  #=>  [ 3, 3, 5 ]
 */

static VALUE
rb_ary_diff(ary1, ary2)
    VALUE ary1, ary2;
{
    VALUE ary3;
    volatile VALUE hash;
    long i;

    hash = ary_make_hash(to_ary(ary2), 0);
    ary3 = rb_ary_new();

    for (i=0; i<RARRAY(ary1)->len; i++) {
    if (st_lookup(RHASH(hash)->tbl, RARRAY(ary1)->ptr[i], 0)) continue;
    rb_ary_push(ary3, rb_ary_elt(ary1, i));
    }
    return ary3;
}:@source_type:c

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
pry-doc-0.4.4 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_18/objects/Array/-_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_18/objects/Array/-_i.dat