Bug 192813 - Use idiomatic const references for equality helper methods for WTF::StringView class
Summary: Use idiomatic const references for equality helper methods for WTF::StringVie...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-18 10:51 PST by David Kilzer (:ddkilzer)
Modified: 2020-06-03 18:31 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1 (5.26 KB, patch)
2018-12-18 10:53 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 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).
Comment 1 David Kilzer (:ddkilzer) 2018-12-18 10:53:47 PST
Created attachment 357580 [details]
Patch v1
Comment 2 Darin Adler 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.
Comment 3 David Kilzer (:ddkilzer) 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.