Skip to content

Commit d454447

Browse files
committed
minor optimization when calling Encoding.list
1 parent 0bd310a commit d454447

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ enc_names(VALUE self)
13941394
static VALUE
13951395
enc_list(VALUE klass)
13961396
{
1397-
VALUE ary = rb_ary_new2(0);
1397+
VALUE ary = rb_ary_new2(ENCODING_LIST_CAPA);
13981398
VALUE list = RUBY_ATOMIC_VALUE_LOAD(rb_encoding_list);
13991399
rb_ary_replace(ary, list);
14001400
return ary;

0 commit comments

Comments
 (0)