Check if `last < i` before writing, to avoid the potential of unnecessary syscalls.