Bug 192813

Summary: Use idiomatic const references for equality helper methods for WTF::StringView class
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Web Template FrameworkAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED WONTFIX    
Severity: Normal CC: achristensen, benjamin, cdumez, cmarcelo, darin, dbates, ews-watchlist
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=192816
Attachments:
Description Flags
Patch v1 none

David Kilzer (:ddkilzer)
Reported 2018-12-18 10:51:29 PST
Use idiomatic const references for equality methods in WTF::StringView class. Nearly all other `operator==(const TypeName&) const` methods use const references to avoid object copies when comparing two objects. StringView should do the same (unless I'm forgetting why it's not doing this).
Attachments
Patch v1 (5.26 KB, patch)
2018-12-18 10:53 PST, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2018-12-18 10:53:47 PST
Created attachment 357580 [details] Patch v1
Darin Adler
Comment 2 2018-12-19 18:42:16 PST
We don’t do this because it’s not more efficient with StringView; fits well into registers, no work required on copying in production builds. Anders Carlsson originally proposed this. I don’t see any good reason to change this.
David Kilzer (:ddkilzer)
Comment 3 2018-12-20 04:58:43 PST
(In reply to Darin Adler from comment #2) > We don’t do this because it’s not more efficient with StringView; fits well > into registers, no work required on copying in production builds. Anders > Carlsson originally proposed this. > > I don’t see any good reason to change this. Okay.
Note You need to log in before you can comment on or make changes to this bug.