[前][次][番号順一覧][スレッド一覧]

ruby-changes:58484

From: Lourens <ko1@a...>
Date: Tue, 29 Oct 2019 11:31:33 +0900 (JST)
Subject: [ruby-changes:58484] 4480d68931 (master): Right size the compile option hash

https://git.ruby-lang.org/ruby.git/commit/?id=4480d68931

From 4480d68931f3c7b25e194b30dea304b294744c92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lourens=20Naud=C3=A9?= <lourens@b...>
Date: Mon, 21 Oct 2019 23:28:41 +0100
Subject: Right size the compile option hash


diff --git a/iseq.c b/iseq.c
index 8285aad..0ca697c 100644
--- a/iseq.c
+++ b/iseq.c
@@ -720,7 +720,7 @@ make_compile_option(rb_compile_option_t *option, VALUE opt) https://github.com/ruby/ruby/blob/trunk/iseq.c#L720
 static VALUE
 make_compile_option_value(rb_compile_option_t *option)
 {
-    VALUE opt = rb_hash_new();
+    VALUE opt = rb_hash_new_with_size(11);
 #define SET_COMPILE_OPTION(o, h, mem) \
   rb_hash_aset((h), ID2SYM(rb_intern(#mem)), (o)->mem ? Qtrue : Qfalse)
 #define SET_COMPILE_OPTION_NUM(o, h, mem) \
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]