core_assertions.rb: Fix backward compatibility with pre 2.7

This commit is contained in:
Nobuyoshi Nakada 2023-03-22 23:07:26 +09:00
parent 27916db08c
commit e340eb2106
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -746,7 +746,7 @@ eom
def assert_linear_performance(seq, rehearsal: nil, pre: ->(n) {n})
first = seq.first
*arg = pre.call(first)
times = (0..(rehearsal || (2 * first))).filter_map do
times = (0..(rehearsal || (2 * first))).map do
st = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield(*arg)
t = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st)