diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-02-17 23:28:00 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-02-17 23:28:00 +0900 |
commit | 3dccb716daaee74d2ae00a5766fe1779fe220a81 (patch) | |
tree | 00cd2aeea7706eebaff32c2729e83dba4c29376b /numeric.c | |
parent | df63e5bef67ff74216834f61748aa6ea8b0de22e (diff) |
Use `defined?(yield)` and `SIZED_ENUMERATOR`
Prefer built-in features over method calls that may be overridden.
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -5664,6 +5664,12 @@ int_downto(VALUE from, VALUE to) return from; } +static VALUE +int_dotimes_size(VALUE num, VALUE args, VALUE eobj) +{ + return int_neg_p(num) ? INT2FIX(0) : num; +} + /* * call-seq: * round(ndigits= 0, half: :up) -> integer |