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.
|
||||
*/
|
||||
|
||||
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)
|
|||
*
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
false_xor(VALUE obj, VALUE obj2)
|
||||
{
|
||||
return RTEST(obj2)?Qtrue:Qfalse;
|
||||
}
|
||||
#define false_xor true_and
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
|
Loading…
Reference in a new issue