Bug 144025 - Web Inspector: Use String.prototype.startsWith in more places
Summary: Web Inspector: Use String.prototype.startsWith in more places
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
Keywords: DoNotImportToRadar
Depends on:
Reported: 2015-04-21 17:50 PDT by Joseph Pecoraro
Modified: 2015-04-21 19:38 PDT (History)
8 users (show)

See Also:

[PATCH] Proposed Fix (2.87 KB, patch)
2015-04-21 17:51 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 2015-04-21 17:50:15 PDT
Use String.prototype.startsWith in more places.

Checking `"haystack".indexOf("needle") === 0` may be less efficient, but certainly is less readable, then `"haystack".startsWith("needle")` which can bail after the first character comparison.
Comment 1 Joseph Pecoraro 2015-04-21 17:51:16 PDT
Created attachment 251282 [details]
[PATCH] Proposed Fix
Comment 2 WebKit Commit Bot 2015-04-21 19:38:15 PDT
Comment on attachment 251282 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 251282

Committed r183092: <http://trac.webkit.org/changeset/183092>
Comment 3 WebKit Commit Bot 2015-04-21 19:38:20 PDT
All reviewed patches have been landed.  Closing bug.