diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-07-24 04:49:51 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-07-24 04:49:51 +0900 |
commit | a4e5690760c9177bc4234fdc5152d82ba73d26d0 (patch) | |
tree | 4c98e96c6cc22fc35b94299b33291840d7e9e837 | |
parent | 9aba971e42c78bb9e446f28c0402bad55147a863 (diff) | |
download | ruby-a4e5690760c9177bc4234fdc5152d82ba73d26d0.tar.gz |
transcode.c (rb_econv_open0): remove unused code
Coverity Scan found this.
-rw-r--r-- | transcode.c | 19 |
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; |