Use memcpy instead of a manual loop and replace the computation in every iteration with a simple increment. #143