summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 22:34:53 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 22:34:53 +0000
commitbaeb94fa3db4325d869f66fdbab3975efda21e92 (patch)
tree6a189ac03f43a3e19924185a2e87fe2a6ee5f543
parent0bd492c6bf0d8199a6783184f2599968ac328ca8 (diff)
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@gmx.de> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--cont.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 99c0708..949899e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Oct 16 06:13:09 2014 Knut Franke <Knut.Franke@gmx.de>
+
+ * cont.c (cont_capture): remove unnecessary variable
+ [ruby-core:65518] [Feature #10341]
+
Thu Oct 16 05:02:31 2014 Knut Franke <Knut.Franke@gmx.de>
* cont.c (fiber_store, fiber_switch): simplify
diff --git a/cont.c b/cont.c
index 49b7702..ab17dcc 100644
--- a/cont.c
+++ b/cont.c
@@ -450,14 +450,13 @@ static VALUE
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)
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);