зеркало из https://github.com/github/ruby.git
* numeric.c (num_step): use rb_equal for zero check. rb_num_coerce_cmp
created an object which caused extra overhead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
37153c03f8
Коммит
64a76ee8a8
|
@ -1,3 +1,8 @@
|
|||
Fri Mar 18 00:15:05 2016 Yusuke Endoh <mame@ruby-lang.org>
|
||||
|
||||
* numeric.c (num_step): use rb_equal for zero check. rb_num_coerce_cmp
|
||||
created an object which caused extra overhead.
|
||||
|
||||
Thu Mar 17 22:21:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
|
||||
|
|
|
@ -2224,7 +2224,7 @@ num_step(int argc, VALUE *argv, VALUE from)
|
|||
RETURN_SIZED_ENUMERATOR(from, argc, argv, num_step_size);
|
||||
|
||||
desc = num_step_scan_args(argc, argv, &to, &step);
|
||||
if (RTEST(rb_num_coerce_cmp(step, INT2FIX(0), id_eq))) {
|
||||
if (rb_equal(step, INT2FIX(0))) {
|
||||
inf = 1;
|
||||
}
|
||||
else if (RB_TYPE_P(to, T_FLOAT)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче