aboutsummaryrefslogtreecommitdiffstats
path: root/transcode.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-07-24 04:49:51 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-07-24 04:49:51 +0900
commita4e5690760c9177bc4234fdc5152d82ba73d26d0 (patch)
tree4c98e96c6cc22fc35b94299b33291840d7e9e837 /transcode.c
parent9aba971e42c78bb9e446f28c0402bad55147a863 (diff)
downloadruby-a4e5690760c9177bc4234fdc5152d82ba73d26d0.tar.gz
transcode.c (rb_econv_open0): remove unused code
Coverity Scan found this.
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/transcode.c b/transcode.c
index 0f72a2d735..86ca57b748 100644
--- a/transcode.c
+++ b/transcode.c
@@ -974,21 +974,10 @@ rb_econv_open0(const char *sname, const char *dname, int ecflags)
int num_trans;
rb_econv_t *ec;
- int sidx, didx;
-
- if (*sname) {
- sidx = rb_enc_find_index(sname);
- if (0 <= sidx) {
- rb_enc_from_index(sidx);
- }
- }
-
- if (*dname) {
- didx = rb_enc_find_index(dname);
- if (0 <= didx) {
- rb_enc_from_index(didx);
- }
- }
+ /* Just check if sname and dname are defined */
+ /* (This check is needed?) */
+ if (*sname) rb_enc_find_index(sname);
+ if (*dname) rb_enc_find_index(dname);
if (*sname == '\0' && *dname == '\0') {
num_trans = 0;