summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-04 18:10:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-14 19:23:25 +0900
commit5ccb625fbbd1e774636a9fdbe0bf1c3d38e085d5 (patch)
tree23a8d2af84fed1b1f080953a5a1eab0b73c3ea8e /array.c
parentee8bcbf40578c0c4e60063a3e0c86439a6891131 (diff)
Use `roomof` macro for rounding up divisions
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 73e8a3c9ce..a33c43bdbf 100644
--- a/array.c
+++ b/array.c
@@ -1389,7 +1389,7 @@ ary_make_partial_step(VALUE ary, VALUE klass, long offset, long len, long step)
}
long ustep = (step < 0) ? -step : step;
- len = (len + ustep - 1) / ustep;
+ len = roomof(len, ustep);
long i;
long j = offset + ((step > 0) ? 0 : (orig_len - 1));