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

ruby-changes:54024

From: normal <ko1@a...>
Date: Thu, 6 Dec 2018 19:41:15 +0900 (JST)
Subject: [ruby-changes:54024] normal:r66244 (trunk): io.c (io_fflush): eliminate redundant rb_io_check_closed

normal	2018-12-06 19:41:07 +0900 (Thu, 06 Dec 2018)

  New Revision: 66244

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66244

  Log:
    io.c (io_fflush): eliminate redundant rb_io_check_closed
    
    There is no need to call this function twice in a row since
    thread switching won't happen in-between calls to it.

  Modified files:
    trunk/io.c
Index: io.c
===================================================================
--- io.c	(revision 66243)
+++ io.c	(revision 66244)
@@ -1158,7 +1158,6 @@ io_fflush(rb_io_t *fptr) https://github.com/ruby/ruby/blob/trunk/io.c#L1158
     rb_io_check_closed(fptr);
     if (fptr->wbuf.len == 0)
         return 0;
-    rb_io_check_closed(fptr);
     while (fptr->wbuf.len > 0 && io_flush_buffer(fptr) != 0) {
 	if (!rb_io_wait_writable(fptr->fd))
 	    return -1;

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

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