Bug 219033

Summary: StringBuilder append(const String& string) has a few redundant checks
Product: WebKit Reporter: xc.o.c.1180 <xc.o.c.1180>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: darin, keith_miller, mark.lam, saam, smoley, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch. none

Description xc.o.c.1180@gmail.com 2020-11-17 07:27:42 PST
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.
Comment 1 Radar WebKit Bug Importer 2020-11-18 10:37:16 PST
<rdar://problem/71545904>
Comment 2 Darin Adler 2020-11-18 18:41:20 PST
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.