ruby-changes:52266
From: normal <ko1@a...>
Date: Mon, 20 Aug 2018 05:16:18 +0900 (JST)
Subject: [ruby-changes:52266] normal:r64474 (trunk): thread_sync.rb (rb_condvar_wait): golf out unnecessary variables
normal 2018-08-20 05:16:15 +0900 (Mon, 20 Aug 2018) New Revision: 64474 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64474 Log: thread_sync.rb (rb_condvar_wait): golf out unnecessary variables GCC is smart enough to optimize these away, but my attention span is too short :{ Modified files: trunk/thread_sync.c Index: thread_sync.c =================================================================== --- thread_sync.c (revision 64473) +++ thread_sync.c (revision 64474) @@ -1383,14 +1383,11 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/thread_sync.c#L1383 rb_condvar_wait(int argc, VALUE *argv, VALUE self) { struct rb_condvar *cv = condvar_ptr(self); - VALUE mutex, timeout; struct sleep_call args; struct sync_waiter w; - rb_scan_args(argc, argv, "11", &mutex, &timeout); + rb_scan_args(argc, argv, "11", &args.mutex, &args.timeout); - args.mutex = mutex; - args.timeout = timeout; w.th = GET_THREAD(); list_add_tail(&cv->waitq, &w.node); rb_ensure(do_sleep, (VALUE)&args, delete_from_waitq, (VALUE)&w); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/