ruby-changes:58485
From: Lourens <ko1@a...>
Date: Tue, 29 Oct 2019 11:31:47 +0900 (JST)
Subject: [ruby-changes:58485] 0e68913f81 (master): Right size the Enumerator internal lazy_use_super_method hash
https://git.ruby-lang.org/ruby.git/commit/?id=0e68913f81 From 0e68913f81eb35ae615592986a23b0f8f22501c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lourens=20Naud=C3=A9?= <lourens@b...> Date: Mon, 21 Oct 2019 23:31:46 +0100 Subject: Right size the Enumerator internal lazy_use_super_method hash diff --git a/enumerator.c b/enumerator.c index 06e2a9e..5f21455 100644 --- a/enumerator.c +++ b/enumerator.c @@ -4016,7 +4016,7 @@ InitVM_Enumerator(void) https://github.com/ruby/ruby/blob/trunk/enumerator.c#L4016 rb_define_method(rb_cLazy, "uniq", lazy_uniq, 0); rb_define_method(rb_cLazy, "with_index", lazy_with_index, -1); - lazy_use_super_method = rb_hash_new(); + lazy_use_super_method = rb_hash_new_with_size(18); rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("map")), ID2SYM(rb_intern("_enumerable_map"))); rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("collect")), ID2SYM(rb_intern("_enumerable_collect"))); rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("flat_map")), ID2SYM(rb_intern("_enumerable_flat_map"))); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/