diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 15:31:35 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 15:31:35 +0000 |
| commit | 91910581fcfcecaf7bf05792c6cfc6bfe3f9b6fb (patch) | |
| tree | b7bb3649d7215595fa32ccfa1a1ed3f7c3437819 | |
| parent | a9246704b145d362f644c9cc262d20d6c2dba990 (diff) | |
merges r24342 and r24348 from trunk into ruby_1_9_1.
--
Can't use singlebyte optimization when the replacement is multibyte. [ruby-core:24612]
* string.c (tr_trans): can't use singlebyte optimization when
the replacement is multibyte. [ruby-core:24612]
--
* string.c (tr_trans): change condition of singlebyte optimization.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 10 | ||||
| -rw-r--r-- | string.c | 2 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,13 @@ +Sat Aug 1 19:23:27 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * string.c (tr_trans): change condition of singlebyte + optimization. + +Sat Aug 1 05:18:36 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * string.c (tr_trans): can't use singlebyte optimization when + the replacement is multibyte. [ruby-core:24612] + Fri Jul 31 16:28:33 2009 NARUSE, Yui <naruse@ruby-lang.org> * io.c (rb_stdio_set_default_encoding): added. @@ -4681,7 +4681,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) if (r == errc) r = trrepl.now; if (c < 256) { trans[c] = r; - if (r > 255) singlebyte = 0; + if (rb_enc_codelen(r, enc) != 1) singlebyte = 0; } else { if (!hash) hash = rb_hash_new(); @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 261 +#define RUBY_PATCHLEVEL 262 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
