mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
complex.c: refactoring
* complex.c (f_one_p): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
912857340b
commit
7c451099f5
1 changed files with 0 additions and 19 deletions
19
complex.c
19
complex.c
|
@ -206,25 +206,6 @@ f_zero_p(VALUE x)
|
|||
|
||||
#define f_nonzero_p(x) (!f_zero_p(x))
|
||||
|
||||
inline static VALUE
|
||||
f_one_p(VALUE x)
|
||||
{
|
||||
if (FIXNUM_P(x)) {
|
||||
return f_boolcast(FIX2LONG(x) == 1);
|
||||
}
|
||||
else if (RB_TYPE_P(x, T_BIGNUM)) {
|
||||
return Qfalse;
|
||||
}
|
||||
else if (RB_TYPE_P(x, T_RATIONAL)) {
|
||||
VALUE num = RRATIONAL(x)->num;
|
||||
VALUE den = RRATIONAL(x)->den;
|
||||
|
||||
return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 1 &&
|
||||
FIXNUM_P(den) && FIX2LONG(den) == 1);
|
||||
}
|
||||
return rb_funcall(x, id_eqeq_p, 1, ONE);
|
||||
}
|
||||
|
||||
inline static VALUE
|
||||
f_kind_of_p(VALUE x, VALUE c)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue