[Webkit-unassigned] [Bug 228122] Expand URL class query parameter functions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 30 17:06:04 PDT 2021


--- Comment #17 from Darin Adler <darin at apple.com> ---
Comment on attachment 434669
  --> https://bugs.webkit.org/attachment.cgi?id=434669

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

>>> Source/WTF/wtf/URL.cpp:1176
>>> +    auto otherQueryParameters = URLParser::parseURLEncodedForm(otherURL.query());
>> It seems to me would could implement this operation significantly more efficiently by sorting both vectors and walking through them, rather than using a hash table.
> Wouldn't sorting be costly in terms of time? We preferred to sacrifice some memory. Although the length of the URL and the number of the parameter is not that huge, still we can discuss about any kind of optimization.

No, I don’t think so.

>>> Source/WTF/wtf/URL.cpp:1250
>>> +    setQuery(StringView(queryWithoutRemovalKeys));
>> There should not be a need to call StringView() here explicitly.
> setQuery(StringView) takes StringView as argument. Will it type cast to StringView automatically if we provide String?


>>> Source/WTF/wtf/URL.h:207
>>> +    WTF_EXPORT_PRIVATE void removeQueryParameters(const HashSet<String>&);
>> How did you decide that these should be members of the URL class rather than functions that take a URL? In particular, the ones that take two URLs seem like they should be functions that take two URLs.
> I am sorry I am a little bit unclear here. It would be very helpful if I could be a bit clear.


    bool areEqualIgnoringQueryAndFragments(const URL&, const URL&);

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210731/c8b9b37f/attachment-0001.htm>

More information about the webkit-unassigned mailing list