Improve calc_read_size

This commit is contained in:
Shinya Maeda 2017-05-17 20:39:47 +09:00
parent 8c1b07e0cc
commit fdcd2f192d
1 changed files with 2 additions and 6 deletions

View File

@ -116,12 +116,8 @@ module Gitlab
end
def calc_read_size(pos, max)
if pos > max
BUFFER_SIZE + (pos - max)
else
remain = max - pos
(remain > BUFFER_SIZE) ? BUFFER_SIZE : remain
end
remain = max - pos
(remain > BUFFER_SIZE) ? BUFFER_SIZE : remain
end
end
end