Instead of using two pointers to iterate through the string, iterate using just one.
mentioned in commit 04fcc449