mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Share logically equivalent functions
This commit is contained in:
parent
2273af56db
commit
eb0125957b
1 changed files with 2 additions and 12 deletions
14
object.c
14
object.c
|
@ -1624,13 +1624,7 @@ false_and(VALUE obj, VALUE obj2)
|
||||||
* <code>nil</code> or <code>false</code>; <code>true</code> otherwise.
|
* <code>nil</code> or <code>false</code>; <code>true</code> otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
#define false_or true_and
|
||||||
false_or(VALUE obj, VALUE obj2)
|
|
||||||
{
|
|
||||||
return RTEST(obj2)?Qtrue:Qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
|
@ -1643,11 +1637,7 @@ false_or(VALUE obj, VALUE obj2)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
#define false_xor true_and
|
||||||
false_xor(VALUE obj, VALUE obj2)
|
|
||||||
{
|
|
||||||
return RTEST(obj2)?Qtrue:Qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
|
|
Loading…
Reference in a new issue