summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-01-07 11:03:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-23 14:12:36 +0900
commit0d41adf6e2d10ef699e291f468ee955b25671d6f (patch)
treea5601ebea6d56d09ce1e69cfa826ec2d61c5ab24 /complex.c
parent4946c3e4b5e465c743da3050169fdb1f7b060c95 (diff)
Split long expression
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/complex.c b/complex.c
index e5d4a1192a..aa905c1c88 100644
--- a/complex.c
+++ b/complex.c
@@ -845,12 +845,11 @@ f_divide(VALUE self, VALUE other,
return f_complex_new2(CLASS_OF(self), x, y);
}
if (k_numeric_p(other) && f_real_p(other)) {
+ VALUE x, y;
get_dat1(self);
- return f_complex_new2(CLASS_OF(self),
- rb_rational_canonicalize(
- (*func)(dat->real, other)),
- rb_rational_canonicalize(
- (*func)(dat->imag, other)));
+ x = rb_rational_canonicalize((*func)(dat->real, other));
+ y = rb_rational_canonicalize((*func)(dat->imag, other));
+ return f_complex_new2(CLASS_OF(self), x, y);
}
return rb_num_coerce_bin(self, other, id);
}