Bug 225732 - Remove StringBuilder::appendNumber
Summary: Remove StringBuilder::appendNumber
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P3 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-12 21:21 PDT by Darin Adler
Modified: 2021-05-13 09:19 PDT (History)
40 users (show)

See Also:


Attachments
Patch (103.76 KB, patch)
2021-05-12 21:41 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2021-05-12 21:21:39 PDT
Remove StringBuilder::appendNumber
Comment 1 Darin Adler 2021-05-12 21:41:56 PDT
Created attachment 428458 [details]
Patch
Comment 2 EWS Watchlist 2021-05-12 21:42:46 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Sam Weinig 2021-05-13 08:29:08 PDT
Comment on attachment 428458 [details]
Patch

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

> Source/WTF/ChangeLog:9
> +        We originally added StringBuilder::appendNumber to resolve the ambiguity
> +        between UChar and uint16_t, but that problem was solved long ago and it

I hadn't realized we had done this otherwise I would have totally done this myself. That's great! Next up should we remove appendLiteral?

> Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:277
> +            String errorMessage = makeString("Failed to load resource: the server responded with a status of ", response.httpStatusCode(), " (", response.httpStatusText(), ')');

I would leave out the String and use auto here.
Comment 4 Darin Adler 2021-05-13 08:48:48 PDT
Comment on attachment 428458 [details]
Patch

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

>> Source/WTF/ChangeLog:9
>> +        between UChar and uint16_t, but that problem was solved long ago and it
> 
> I hadn't realized we had done this otherwise I would have totally done this myself. That's great! Next up should we remove appendLiteral?

Yes I have been thinking about that. The appendLiteral function does optimization that is not very valuable; it may save some looping over characters to find the string length, and it may be optimizing memory use by using characters in place for the case where only a single literal ends up contributing the entries content of the result string. We could work to keep one or both of these optimizations using ASCIILiteral or a variant on it, for StringBuilder itself and for string concatenation. Or, more likely, we could just forgo both.

I can’t remember why I thought it was worth adding.
Comment 5 Darin Adler 2021-05-13 08:56:10 PDT
entire content, not entries content
Comment 6 EWS 2021-05-13 09:18:42 PDT
Committed r277437 (237685@main): <https://commits.webkit.org/237685@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428458 [details].
Comment 7 Radar WebKit Bug Importer 2021-05-13 09:19:14 PDT
<rdar://problem/77968469>