1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

array.c: new names of rb_ary_new family

* array.c (rb_ary_new_capa): add better names of rb_ary_new2.
* array.c (rb_ary_new_from_args): ditto for rb_ary_new3.
* array.c (rb_ary_new_from_values): ditto for rb_ary_new4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-31 08:04:56 +00:00
parent 58bec3e2cb
commit 1c5cdc62cc
4 changed files with 20 additions and 9 deletions

View file

@ -1,3 +1,11 @@
Fri May 31 17:04:45 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_new_capa): add better names of rb_ary_new2.
* array.c (rb_ary_new_from_args): ditto for rb_ary_new3.
* array.c (rb_ary_new_from_values): ditto for rb_ary_new4.
Fri May 31 16:35:44 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (HAVE_ATTRIBUTE_FUNCTION_ALIAS): define to tell if

View file

@ -250,15 +250,18 @@ rb_ary_new() ::
Creates an array with no elements.
rb_ary_new2(long len) ::
rb_ary_new_capa(long len) ::
Creates an array with no elements, allocating internal buffer
for len elements.
rb_ary_new3(long n, ...) ::
rb_ary_new_from_args(long n, ...) ::
Creates an n-element array from the arguments.
rb_ary_new4(long n, VALUE *elts) ::
rb_ary_new_from_values(long n, VALUE *elts) ::
Creates an n-element array from a C array.

View file

@ -425,22 +425,19 @@ ary_new(VALUE klass, long capa)
}
VALUE
rb_ary_new2(long capa)
rb_ary_new_capa(long capa)
{
return ary_new(rb_cArray, capa);
}
VALUE
rb_ary_new(void)
{
return rb_ary_new2(RARRAY_EMBED_LEN_MAX);
}
#include <stdarg.h>
VALUE
rb_ary_new3(long n, ...)
rb_ary_new_from_args(long n, ...)
{
va_list ar;
VALUE ary;
@ -459,7 +456,7 @@ rb_ary_new3(long n, ...)
}
VALUE
rb_ary_new4(long n, const VALUE *elts)
rb_ary_new_from_values(long n, const VALUE *elts)
{
VALUE ary;

View file

@ -48,9 +48,9 @@ void rb_mem_clear(register VALUE*, register long);
VALUE rb_assoc_new(VALUE, VALUE);
VALUE rb_check_array_type(VALUE);
VALUE rb_ary_new(void);
VALUE rb_ary_new2(long);
VALUE rb_ary_new3(long,...);
VALUE rb_ary_new4(long, const VALUE *);
VALUE rb_ary_new_capa(long capa);
VALUE rb_ary_new_from_args(long n, ...);
VALUE rb_ary_new_from_values(long n, const VALUE *elts);
VALUE rb_ary_tmp_new(long);
void rb_ary_free(VALUE);
void rb_ary_modify(VALUE);
@ -86,6 +86,9 @@ VALUE rb_ary_cmp(VALUE, VALUE);
VALUE rb_ary_replace(VALUE copy, VALUE orig);
VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
VALUE rb_ary_resize(VALUE ary, long len);
#define rb_ary_new2 rb_ary_new_capa
#define rb_ary_new3 rb_ary_new_from_args
#define rb_ary_new4 rb_ary_new_from_values
/* bignum.c */
VALUE rb_big_new(long, int);
int rb_bigzero_p(VALUE x);