Optimization

Instead of checking whether it's the end of string on every iteration
and since it's a for loop (it'll end at end of string anyways), just
check if the buffer is not empty then push it to params array.