ruby-changes:61029
From: Nobuyoshi <ko1@a...>
Date: Thu, 7 May 2020 05:23:05 +0900 (JST)
Subject: [ruby-changes:61029] eb0125957b (master): Share logically equivalent functions
https://git.ruby-lang.org/ruby.git/commit/?id=eb0125957b From eb0125957b3c32727a7c199f1f3041c1d2b9a475 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 7 May 2020 01:51:03 +0900 Subject: Share logically equivalent functions diff --git a/object.c b/object.c index d3e100d..2a01cbb 100644 --- a/object.c +++ b/object.c @@ -1624,13 +1624,7 @@ false_and(VALUE obj, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/object.c#L1624 * <code>nil</code> or <code>false</code>; <code>true</code> otherwise. */ -static VALUE -false_or(VALUE obj, VALUE obj2) -{ - return RTEST(obj2)?Qtrue:Qfalse; -} - - +#define false_or true_and /* * call-seq: @@ -1643,11 +1637,7 @@ false_or(VALUE obj, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/object.c#L1637 * */ -static VALUE -false_xor(VALUE obj, VALUE obj2) -{ - return RTEST(obj2)?Qtrue:Qfalse; -} +#define false_xor true_and /* * call-seq: -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/