Prefer String#each_byte when using a block

This commit is contained in:
Nobuyoshi Nakada 2020-06-15 16:20:56 +09:00
parent 8f99bfa26d
commit 2a20c17982
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -1414,7 +1414,7 @@ module MiniTest
end end
suites = suites.sort_by do |suite| suites = suites.sort_by do |suite|
crc32 = 0xffffffff crc32 = 0xffffffff
(suite.name + salt).bytes do |data| (suite.name + salt).each_byte do |data|
crc32 = crc_tbl[(crc32 ^ data) & 0xff] ^ (crc32 >> 8) crc32 = crc_tbl[(crc32 ^ data) & 0xff] ^ (crc32 >> 8)
end end
crc32 ^ 0xffffffff crc32 ^ 0xffffffff