ruby-changes:50039
From: nobu <ko1@a...>
Date: Fri, 2 Feb 2018 17:31:04 +0900 (JST)
Subject: [ruby-changes:50039] nobu:r62157 (trunk): io.c: unused assignments
nobu 2018-02-02 17:30:57 +0900 (Fri, 02 Feb 2018) New Revision: 62157 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62157 Log: io.c: unused assignments * io.c (fptr_finalize_flush): removed unused assignments. if noraise, err is never used after set. Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 62156) +++ io.c (revision 62157) @@ -4523,8 +4523,7 @@ fptr_finalize_flush(rb_io_t *fptr, int n https://github.com/ruby/ruby/blob/trunk/io.c#L4523 } if (fptr->wbuf.len) { if (noraise) { - if ((int)io_flush_buffer_sync(fptr) < 0 && NIL_P(err)) - err = Qtrue; + io_flush_buffer_sync(fptr); } else { if (io_fflush(fptr) < 0 && NIL_P(err)) @@ -4543,7 +4542,7 @@ fptr_finalize_flush(rb_io_t *fptr, int n https://github.com/ruby/ruby/blob/trunk/io.c#L4542 /* stdio_file is deallocated anyway * even if fclose failed. */ if ((maygvl_fclose(stdio_file, noraise) < 0) && NIL_P(err)) - err = noraise ? Qtrue : INT2NUM(errno); + if (!noraise) err = INT2NUM(errno); } else if (0 <= fd) { /* fptr->fd may be closed even if close fails. @@ -4554,7 +4553,7 @@ fptr_finalize_flush(rb_io_t *fptr, int n https://github.com/ruby/ruby/blob/trunk/io.c#L4553 keepgvl |= !(mode & FMODE_WRITABLE); keepgvl |= noraise; if ((maygvl_close(fd, keepgvl) < 0) && NIL_P(err)) - err = noraise ? Qtrue : INT2NUM(errno); + if (!noraise) err = INT2NUM(errno); } if (!NIL_P(err) && !noraise) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/