From 4fb1cf8acd2e1efb88eb2a87cd5008dfd126a58b Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 20 Feb 2008 10:44:28 +0000 Subject: * encoding.c (rb_enc_associate_index): doesn't clear coderange when new encoding equals to old one. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- encoding.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'encoding.c') diff --git a/encoding.c b/encoding.c index 15a068728..b64688e0f 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); -- cgit