Condition `new_len < old_len` can be removed, because `i < old_len - new_len` already contains it.