# File lib/ole/storage/base.rb, line 573 def blocks_to_ranges chain, size=nil #super chain.map { |b| b + 1 }, size # duplicated from AllocationTable#blocks_to_ranges to avoid chain.map # which was decent part of benchmark profile chain = chain[0, (size.to_f / block_size).ceil] if size ranges = chain.map { |i| [block_size * (i + 1), block_size] } ranges.last[1] -= (ranges.length * block_size - size) if ranges.last and size ranges end