Bug 67340 - Remove simple usage of UString::characters() from JavaScriptCore
Summary: Remove simple usage of UString::characters() from JavaScriptCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks: 66661
  Show dependency treegraph
 
Reported: 2011-08-31 16:50 PDT by Michael Saboff
Modified: 2011-09-01 13:39 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (9.22 KB, patch)
2011-09-01 12:16 PDT, Michael Saboff
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2011-08-31 16:50:03 PDT
As part of the changes for https://bugs.webkit.org/show_bug.cgi?id=66161 it would simplify the work if simple usage of the existing UString::characters() method where changed to other forms.

For example, there are many cases where the code does s.characters()[0] which can be directly replaced with s[0].
Comment 1 Michael Saboff 2011-09-01 12:16:53 PDT
Created attachment 106006 [details]
Proposed patch
Comment 2 Geoffrey Garen 2011-09-01 12:19:53 PDT
Comment on attachment 106006 [details]
Proposed patch

r=me
Comment 3 Michael Saboff 2011-09-01 13:03:46 PDT
Committed r94336: <http://trac.webkit.org/changeset/94336>
Comment 4 Darin Adler 2011-09-01 13:39:50 PDT
This adds code to each call site, checking the number against the length of the string. Is there a measurable performance cost? Should we redo this in a way that does not have performance cost?