[前][次][番号順一覧][スレッド一覧]

ruby-changes:56510

From: Yusuke <ko1@a...>
Date: Mon, 15 Jul 2019 00:20:48 +0900 (JST)
Subject: [ruby-changes:56510] Yusuke Endoh: deb5e58230 (master): ext/stringio/stringio.c (strio_read): "binray" is always zero here

https://git.ruby-lang.org/ruby.git/commit/?id=deb5e58230

From deb5e582308950cdceb510807f498a7733dc076f Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Mon, 15 Jul 2019 00:19:41 +0900
Subject: ext/stringio/stringio.c (strio_read): "binray" is always zero here

Remove unused conditional expression to suppress Coverity Scan warnings.

diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index bfe1700..b02fb11 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -1409,7 +1409,7 @@ strio_read(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L1409
       case 0:
 	len = RSTRING_LEN(ptr->string);
 	if (len <= ptr->pos) {
-	    rb_encoding *enc = binary ? rb_ascii8bit_encoding() : get_enc(ptr);
+	    rb_encoding *enc = get_enc(ptr);
 	    if (NIL_P(str)) {
 		str = rb_str_new(0, 0);
 	    }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]