summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-10 21:22:54 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-10 21:22:54 +0000
commit0a40bcb20b27058f760ce855fc1860a540c49f43 (patch)
tree415dbfc1f9eb4fa0fe5469c894ea67c79342a6bf /vm_eval.c
parentad45aea45631a451ae0b4b4a5592468d0c4617c0 (diff)
* vm_eval.c, internal.h (rb_yield_1): added for performance which
doesn't check Qundef. * numeric.c (int_dotimes): use rb_yield_1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 0abbcc2..780a83b 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1000,13 +1000,19 @@ rb_yield_0(int argc, const VALUE * argv)
}
VALUE
+rb_yield_1(VALUE val)
+{
+ return rb_yield_0(1, &val);
+}
+
+VALUE
rb_yield(VALUE val)
{
if (val == Qundef) {
return rb_yield_0(0, 0);
}
else {
- return rb_yield_0(1, &val);
+ return rb_yield_1(val);
}
}