From 69fa5eea6a2b1f658ed21263f17699393b04bc6e Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 12 Jun 2008 04:46:16 +0000 Subject: * include/ruby/ruby.h (rb_intern): use rb_intern2 with strlen for constant symbols to optimize strlen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ include/ruby/ruby.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 11bd451833..896e278b4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 12 13:36:54 2008 Tanaka Akira + + * include/ruby/ruby.h (rb_intern): use rb_intern2 with strlen for + constant symbols to optimize strlen. + Thu Jun 12 08:47:51 2008 Yukihiro Matsumoto * io.c (read_all): should use io_read_encoding(), not diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 5bae5d392d..d2b9f4c8b3 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -768,7 +768,7 @@ VALUE rb_id2str(ID); { \ static ID rb_intern_id_cache; \ if (!rb_intern_id_cache) \ - rb_intern_id_cache = (rb_intern)(str); \ + rb_intern_id_cache = rb_intern2(str, strlen(str)); \ result rb_intern_id_cache; \ } #define CONST_ID(var, str) \ -- cgit v1.2.3