iozone:17:34: C: Style/SlicingWithRange: Prefer ary[n..] over ary[n..-1]. data.insert i + 1, data[i][-8..-1] ^^^^^ iozone:21:8: C: Style/SlicingWithRange: Prefer ary[n..] over ary[n..-1]. data[2..-1].each_with_index do |v, i| ^^^^^
Signed-off-by: Zhang Yu 2134782174@qq.com --- stats/iozone | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/stats/iozone b/stats/iozone index 32dce7ba..62184cb2 100755 --- a/stats/iozone +++ b/stats/iozone @@ -14,11 +14,11 @@ while (line = STDIN.gets) data = line.split data.each_index do |i| if data[i].size > 8 - data.insert i + 1, data[i][-8..-1] + data.insert i + 1, data[i][-8..] data[i] = data[i][0..-9] end end - data[2..-1].each_with_index do |v, i| + data[2..].each_with_index do |v, i| puts data[0] + 'KB_' + data[1] + 'reclen.' + keys[i] + ': ' + v per_io_type[keys[i]] ||= 0 per_io_type[keys[i]] += v.to_i