Prefer rb_ary_new4() over rb_ary_new3().
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 1 Apr 2007 14:18:06 +0000 (16:18 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 1 Apr 2007 14:18:06 +0000 (16:18 +0200)
ext/ext.c

index 28bfa4cb1ba52c94263f79cd7dff82fe397d5ec7..ea620be810658fcf541a5753c73abe1872daffaa 100644 (file)
--- a/ext/ext.c
+++ b/ext/ext.c
@@ -601,7 +601,7 @@ int_to_eet_chunks (int argc, VALUE *argv, VALUE self)
 
        rb_scan_args (argc, argv, "11", &tag, &type);
 
 
        rb_scan_args (argc, argv, "11", &tag, &type);
 
-       ary = rb_ary_new3 (1, self);
+       ary = rb_ary_new4 (1, &self);
 
        if (type == sym_char)
                cfmt = "c";
 
        if (type == sym_char)
                cfmt = "c";
@@ -614,7 +614,7 @@ int_to_eet_chunks (int argc, VALUE *argv, VALUE self)
        args[1] = rb_funcall (ary, id_pack, 1, rb_str_new2 (cfmt));
        chunk = rb_class_new_instance (2, args, cChunk);
 
        args[1] = rb_funcall (ary, id_pack, 1, rb_str_new2 (cfmt));
        chunk = rb_class_new_instance (2, args, cChunk);
 
-       return rb_ary_new3 (1, chunk);
+       return rb_ary_new4 (1, &chunk);
 }
 
 static VALUE
 }
 
 static VALUE
@@ -644,7 +644,7 @@ float_to_eet_chunks (int argc, VALUE *argv, VALUE self)
        args[1] = rb_str_new (buf, len);
        chunk = rb_class_new_instance (2, args, cChunk);
 
        args[1] = rb_str_new (buf, len);
        chunk = rb_class_new_instance (2, args, cChunk);
 
-       return rb_ary_new3 (1, chunk);
+       return rb_ary_new4 (1, &chunk);
 }
 
 void
 }
 
 void