From 963e6b5d24659da316fd57a91b8229683c3c6df2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 28 Oct 2015 02:03:46 +0000 Subject: bytecode golfing to cut a few bytes of memory Reduce unnecessary arguments to "exit" and "exit!". Additionally, rely on a "putnil" instruction rather than a "putstring" argument with an unnecessary string operand for an uncommon code path. --- lib/yahns/daemon.rb | 4 ++-- lib/yahns/server.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/yahns/daemon.rb b/lib/yahns/daemon.rb index a3ffd8b..fde384c 100644 --- a/lib/yahns/daemon.rb +++ b/lib/yahns/daemon.rb @@ -46,9 +46,9 @@ module Yahns::Daemon # :nodoc: master_pid = (rd.readpartial(16) rescue nil).to_i unless master_pid > 1 warn "master failed to start, check stderr log for details" - exit!(1) + exit! end - exit 0 + exit else # yahns master process yahns_server.daemon_pipe = wr end diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb index 513fadb..4501d86 100644 --- a/lib/yahns/server.rb +++ b/lib/yahns/server.rb @@ -401,7 +401,7 @@ class Yahns::Server # :nodoc: @logger.info("graceful exit aborted, exiting immediately") # we will still call any app-defined at_exit hooks here # use SIGKILL if you don't want that. - exit(0) + exit end drop_acceptors # stop acceptors, we close epolls in quit_done @@ -463,7 +463,7 @@ class Yahns::Server # :nodoc: when :CHLD reap_reexec when :USR1 - usr1_reopen('') + usr1_reopen(nil) when :USR2 reexec when :HUP -- cgit v1.2.3-24-ge0c7