Bug 185935

Summary: Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebCore Misc.Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, darin, joepeck, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2018-05-23 21:25:35 PDT
Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa. All of these convert a string literal into a WTFString.
Comment 1 Joseph Pecoraro 2018-05-23 21:26:23 PDT
Created attachment 341169 [details]
[PATCH] Proposed Fix
Comment 2 Yusuke Suzuki 2018-05-23 22:14:38 PDT
Comment on attachment 341169 [details]
[PATCH] Proposed Fix

r=me
Comment 3 WebKit Commit Bot 2018-05-23 22:42:15 PDT
Comment on attachment 341169 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 341169

Committed r232148: <https://trac.webkit.org/changeset/232148>
Comment 4 WebKit Commit Bot 2018-05-23 22:42:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2018-05-23 22:43:20 PDT
<rdar://problem/40511274>
Comment 6 Darin Adler 2018-05-25 21:19:14 PDT
Can’t we make the function take a const char* instead? Why make a WTF::String at all?
Comment 7 Joseph Pecoraro 2018-05-25 21:36:10 PDT
(In reply to Darin Adler from comment #6)
> Can’t we make the function take a const char* instead? Why make a
> WTF::String at all?

I'd be fine with that too. In this case either would work just fine.
Comment 8 Darin Adler 2018-05-25 21:45:47 PDT
(In reply to Joseph Pecoraro from comment #7)
> (In reply to Darin Adler from comment #6)
> > Can’t we make the function take a const char* instead? Why make a
> > WTF::String at all?
> 
> I'd be fine with that too. In this case either would work just fine.

We should definitely do that. There is no reason to create and destroy a String when these functions are called. On the other hand, the work is only done the first time each is called, so it’s a tiny efficiency.