From 3ee7fcc76364021b3bbc52fcc72845d81b14d375 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 21 May 2009 20:08:03 +0000 Subject: [PATCH] * string.c (rb_str_count): optimized for 1byte string count by avoiding tr_setup_table(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d063d0904a..fd54c360fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,11 @@ Wed May 20 18:34:30 2009 Nobuyoshi Nakada * enumerator.c (inspect_enumerator): should use long. +Wed May 20 09:18:44 2009 Yukihiro Matsumoto + + * string.c (rb_str_count): optimized for 1byte string count by + avoiding tr_setup_table(). + Wed May 20 06:25:29 2009 Yukihiro Matsumoto * encoding.c (rb_enc_fast_mbclen): faster mbclen for strings known diff --git a/string.c b/string.c index 405500b1d2..b714864474 100644 --- a/string.c +++ b/string.c @@ -5380,19 +5380,31 @@ rb_str_count(int argc, VALUE *argv, VALUE str) rb_raise(rb_eArgError, "wrong number of arguments"); } for (i=0; i