From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 10378211BB for ; Fri, 28 Dec 2018 00:33:11 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] server_mp: favor "Kernel#select" instead of "IO.select" Date: Fri, 28 Dec 2018 00:33:10 +0000 Message-Id: <20181228003310.23558-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Golfing to eliminate a constant lookup and inline-constant-cache entry --- lib/yahns/server_mp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yahns/server_mp.rb b/lib/yahns/server_mp.rb index c9cd207..7b2f9b7 100644 --- a/lib/yahns/server_mp.rb +++ b/lib/yahns/server_mp.rb @@ -159,7 +159,7 @@ def run_mp_worker(worker) def mp_sig_handle(watch, alive) # not performance critical watch.delete_if { |io| io.to_io.closed? } - if r = IO.select(watch, nil, nil, alive ? nil : 0.1) + if r = select(watch, nil, nil, alive ? nil : 0.1) r[0].each(&:yahns_step) end case @sig_queue.shift -- EW