提交 3c4a0b2e 编写于 作者: M Marc-Andre Lafortune

Simplify (and optimize)

上级 22edb664
......@@ -67,9 +67,9 @@ def in_groups(number, fill_with = nil)
number.times do |index|
length = division + (modulo > 0 && modulo > index ? 1 : 0)
padding = fill_with != false &&
modulo > 0 && length == division ? 1 : 0
groups << slice(start, length).concat([fill_with] * padding)
groups << last_group = slice(start, length)
last_group << fill_with if fill_with != false &&
modulo > 0 && length == division
start += length
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册