Unroll while loop to improve performance
Unroll while loop to improve performance

In order the improve the performance of the package I've modified the
while loop. Instead of going through the while loop till `num` has
reached `0` the while loop now loops till `num` has reached `1`. The
advantage is that it eliminates the need to check for `!num` inside
the while loop.

To compensate for the lost while iteration it is necessary to manually
perform the concat of `str` to `res` which otherwise would've taken
place.

If the method is called for the same string as the last call, the method
will now check if the cached result is long enough to fulfil the request.
This is needed because else the method will execute the manual concat
just before returning the result.

In addition the value of `res` is set to the exact length that was
requested. This is an optimisation for cases where a consecutive
call for the same string is performed with a higher number of
iterations than the previous one(s). This could lead to `res` with a
substantial longer string than needed.

jonschlinkert/repeat-string