Created attachment 414337 [details] Proposed patch. After 'if (!string.length())', string's StringImpl can not be null, a few null checks can be skipped by using StringImpl reference. Please see patch for details. Thanks.
<rdar://problem/71545904>
Comment on attachment 414337 [details] Proposed patch. Yes, looks OK. Since it makes the code slightly less elegant, and I am not sure it will make things more efficient on any platform, I am not sure we should make the change.