From 1e0958098f4ab4487041070c2d064c14c57406b9 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 20 Feb 2008 10:44:28 +0000 Subject: [PATCH] * encoding.c (rb_enc_associate_index): doesn't clear coderange when new encoding equals to old one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ encoding.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 27c5c60200..1cdd7312d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Feb 20 19:42:03 2008 NARUSE, Yui + + * encoding.c (rb_enc_associate_index): doesn't clear coderange + when new encoding equals to old one. + Wed Feb 20 19:15:38 2008 NARUSE, Yui * string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy. diff --git a/encoding.c b/encoding.c index 15a0687281..b64688e0f5 100644 --- a/encoding.c +++ b/encoding.c @@ -613,6 +613,8 @@ void rb_enc_associate_index(VALUE obj, int idx) { enc_check_capable(obj); + if (rb_enc_get_index(obj) == idx) + return; if (!ENC_CODERANGE_ASCIIONLY(obj) || !rb_enc_asciicompat(rb_enc_from_index(idx))) { ENC_CODERANGE_CLEAR(obj);