Bug 185935 - Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa
Summary: Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksC...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-23 21:25 PDT by Joseph Pecoraro
Modified: 2018-05-25 21:45 PDT (History)
6 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (9.83 KB, patch)
2018-05-23 21:26 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.