Bug 100578 - String::split(UChar, Vector<String>&) shouldn't create a temporary String
Summary: String::split(UChar, Vector<String>&) shouldn't create a temporary String
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:
 
Reported: 2012-10-26 16:47 PDT by Michael Saboff
Modified: 2012-10-29 11:19 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.21 KB, patch)
2012-10-26 17:35 PDT, Michael Saboff
andersca: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch with inlined versions of 2 arg split() (3.11 KB, patch)
2012-10-29 10:36 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2012-10-26 16:47:06 PDT
String::split(UChar separator, Vector<String>& result) creates a single character string from the first argument and then calls the String::split(const String&, bool, Vector<String>&).  Instead it could call the (UChar, bool, Vector<String>&) version of String::split.
Comment 1 Michael Saboff 2012-10-26 17:35:29 PDT
Created attachment 171061 [details]
Patch
Comment 2 WebKit Review Bot 2012-10-26 19:27:22 PDT
Comment on attachment 171061 [details]
Patch

Rejecting attachment 171061 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
erge conflict in Source/WebCore/ChangeLog
Failed to merge in the changes.
Patch failed at 0002 Fix a operator ordering bug in SVGSMILElement::calculateAnimationPercentAndRepeat

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 154.

Full output: http://queues.webkit.org/results/14610261
Comment 3 Darin Adler 2012-10-27 14:01:39 PDT
Comment on attachment 171061 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171061&action=review

> Source/WTF/wtf/text/WTFString.cpp:691
>  void String::split(UChar separator, Vector<String>& result) const
>  {
> -    split(String(&separator, 1), false, result);
> +    split(separator, false, result);
>  }

This could also be inlined in the header.
Comment 4 Michael Saboff 2012-10-29 10:36:57 PDT
Created attachment 171279 [details]
Patch with inlined versions of 2 arg split()
Comment 5 WebKit Review Bot 2012-10-29 11:19:13 PDT
Comment on attachment 171279 [details]
Patch with inlined versions of 2 arg split()

Clearing flags on attachment: 171279

Committed r132828: <http://trac.webkit.org/changeset/132828>
Comment 6 WebKit Review Bot 2012-10-29 11:19:17 PDT
All reviewed patches have been landed.  Closing bug.