From 0d4ba7b58d49576a4cea4892cd272a6b0df81163 Mon Sep 17 00:00:00 2001 From: normal Date: Thu, 6 Dec 2018 10:41:07 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 1 - 1 file changed, 1 deletion(-) diff --git a/io.c b/io.c index 442bf52e40..24dacc5dd8 100644 --- a/io.c +++ b/io.c @@ -1158,7 +1158,6 @@ io_fflush(rb_io_t *fptr) 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;