ruby-changes:35880
From: normal <ko1@a...>
Date: Thu, 16 Oct 2014 07:35:12 +0900 (JST)
Subject: [ruby-changes:35880] normal:r47962 (trunk): cont.c: Small code cleanup
normal 2014-10-16 07:34:53 +0900 (Thu, 16 Oct 2014) New Revision: 47962 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47962 Log: cont.c: Small code cleanup Remove variable that is used only once, several lines after initialization. * cont.c (cont_capture): remove unnecessary variable [ruby-core:65518] [Feature #10341] Author: Knut Franke <Knut.Franke@g...> Modified files: trunk/ChangeLog trunk/cont.c Index: ChangeLog =================================================================== --- ChangeLog (revision 47961) +++ ChangeLog (revision 47962) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Oct 16 06:13:09 2014 Knut Franke <Knut.Franke@g...> + + * cont.c (cont_capture): remove unnecessary variable + [ruby-core:65518] [Feature #10341] + Thu Oct 16 05:02:31 2014 Knut Franke <Knut.Franke@g...> * cont.c (fiber_store, fiber_switch): simplify Index: cont.c =================================================================== --- cont.c (revision 47961) +++ cont.c (revision 47962) @@ -450,14 +450,13 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/cont.c#L450 cont_capture(volatile int *stat) { rb_context_t *cont; - rb_thread_t *th = GET_THREAD(), *sth; + rb_thread_t *th = GET_THREAD(); volatile VALUE contval; THREAD_MUST_BE_RUNNING(th); rb_vm_stack_to_heap(th); cont = cont_new(rb_cContinuation); contval = cont->self; - sth = &cont->saved_thread; #ifdef CAPTURE_JUST_VALID_VM_STACK cont->vm_stack_slen = th->cfp->sp + th->mark_stack_len - th->stack; @@ -469,7 +468,7 @@ cont_capture(volatile int *stat) https://github.com/ruby/ruby/blob/trunk/cont.c#L468 cont->vm_stack = ALLOC_N(VALUE, th->stack_size); MEMCPY(cont->vm_stack, th->stack, VALUE, th->stack_size); #endif - sth->stack = 0; + cont->saved_thread.stack = 0; cont_save_machine_stack(th, cont); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/