Clean up the code such that it passes through the string characters only once.
Created attachment 408419 [details] Patch
<rdar://problem/69042904>