Bug 120277 - JSHTMLFormElement::canGetItemsForName needlessly allocates a Vector
Summary: JSHTMLFormElement::canGetItemsForName needlessly allocates a Vector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 120279 120432
  Show dependency treegraph
 
Reported: 2013-08-25 15:52 PDT by Ryosuke Niwa
Modified: 2013-08-28 11:39 PDT (History)
4 users (show)

See Also:


Attachments
Cleanup (6.80 KB, patch)
2013-08-25 16:03 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-08-25 15:52:59 PDT
There's no reason for JSHTMLFormElement::canGetItemsForName to be allocating a Vector since it only needs to figure out if there is a named item or not:

bool JSHTMLFormElement::canGetItemsForName(ExecState*, HTMLFormElement* form, PropertyName propertyName)
{
    Vector<RefPtr<Node> > namedItems;
    form->getNamedElements(propertyNameToAtomicString(propertyName), namedItems);
    return namedItems.size();
}
Comment 1 Ryosuke Niwa 2013-08-25 16:03:31 PDT
Created attachment 209606 [details]
Cleanup
Comment 2 WebKit Commit Bot 2013-08-25 23:03:58 PDT
Comment on attachment 209606 [details]
Cleanup

Clearing flags on attachment: 209606

Committed r154586: <http://trac.webkit.org/changeset/154586>
Comment 3 WebKit Commit Bot 2013-08-25 23:04:01 PDT
All reviewed patches have been landed.  Closing bug.