ruby-changes:7167
From: akr <ko1@a...>
Date: Mon, 18 Aug 2008 12:49:00 +0900 (JST)
Subject: [ruby-changes:7167] Ruby:r18686 (trunk): * io.c (io_enc_str): code conversion removed.
akr 2008-08-18 12:47:15 +0900 (Mon, 18 Aug 2008) New Revision: 18686 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18686 Log: * io.c (io_enc_str): code conversion removed. (io_enc_str_converted): removed because it is identical to io_enc_str now. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18685) +++ ChangeLog (revision 18686) @@ -1,3 +1,9 @@ +Mon Aug 18 12:45:24 2008 Tanaka Akira <akr@f...> + + * io.c (io_enc_str): code conversion removed. + (io_enc_str_converted): removed because it is identical to + io_enc_str now. + Mon Aug 18 12:12:29 2008 Tanaka Akira <akr@f...> * io.c (io_shift_crbuf): add strp argument to append into existing Index: io.c =================================================================== --- io.c (revision 18685) +++ io.c (revision 18686) @@ -1384,24 +1384,6 @@ io_enc_str(VALUE str, rb_io_t *fptr) { OBJ_TAINT(str); - if (fptr->enc2) { - /* two encodings, so transcode from enc2 to enc */ - /* the methods in transcode.c are static, so call indirectly */ - str = rb_funcall(str, id_encode, 2, - rb_enc_from_encoding(fptr->enc), - rb_enc_from_encoding(fptr->enc2)); - } - else { - /* just one encoding, so associate it with the string */ - rb_enc_associate(str, io_read_encoding(fptr)); - } - return str; -} - -static VALUE -io_enc_str_converted(VALUE str, rb_io_t *fptr) -{ - OBJ_TAINT(str); rb_enc_associate(str, io_read_encoding(fptr)); return str; } @@ -1526,7 +1508,7 @@ io_shift_crbuf(fptr, fptr->crbuf_len, &str); } if (more_char(fptr) == -1) { - return io_enc_str_converted(str, fptr); + return io_enc_str(str, fptr); } } } @@ -2147,7 +2129,7 @@ } } if (!NIL_P(str)) - str = io_enc_str_converted(str, fptr); + str = io_enc_str(str, fptr); } if (!NIL_P(str)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/