summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-20 10:44:28 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-20 10:44:28 +0000
commit1e0958098f4ab4487041070c2d064c14c57406b9 (patch)
tree813f64e0bc0c9442384e7128f28eb43b6c88a801 /encoding.c
parent492f431a46b5742e0c741fb0345e3279661a5762 (diff)
* 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
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c2
1 files changed, 2 insertions, 0 deletions
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);