Bug 225580 - Remove all remaining uses of the String::toInt family of functions
Summary: Remove all remaining uses of the String::toInt family of functions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-09 12:57 PDT by Darin Adler
Modified: 2021-05-10 09:57 PDT (History)
41 users (show)

See Also:


Attachments
Patch (92.10 KB, patch)
2021-05-09 14:07 PDT, Darin Adler
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (92.21 KB, patch)
2021-05-09 14:27 PDT, Darin Adler
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (92.21 KB, patch)
2021-05-09 14:37 PDT, Darin Adler
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (92.21 KB, patch)
2021-05-09 15:02 PDT, Darin Adler
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (92.22 KB, patch)
2021-05-09 15:43 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
Patch (92.23 KB, patch)
2021-05-09 16:26 PDT, Darin Adler
sam: review+
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-09 12:57:18 PDT
Remove all remaining uses of the String::toInt family of functions
Comment 1 Darin Adler 2021-05-09 14:07:58 PDT Comment hidden (obsolete)
Comment 2 Darin Adler 2021-05-09 14:08:57 PDT
Patch got a little bigger because I revisited HTML attributes and made them use parseHTMLInteger instead of parseInteger<>.
Comment 3 Radar WebKit Bug Importer 2021-05-09 14:27:17 PDT
<rdar://problem/77719686>
Comment 4 Darin Adler 2021-05-09 14:27:25 PDT Comment hidden (obsolete)
Comment 5 Darin Adler 2021-05-09 14:37:48 PDT Comment hidden (obsolete)
Comment 6 Darin Adler 2021-05-09 15:02:45 PDT Comment hidden (obsolete)
Comment 7 Darin Adler 2021-05-09 15:43:43 PDT Comment hidden (obsolete)
Comment 8 Darin Adler 2021-05-09 16:26:56 PDT
Created attachment 428143 [details]
Patch
Comment 9 Darin Adler 2021-05-09 18:23:47 PDT
Comment on attachment 428143 [details]
Patch

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

> Source/WebCore/editing/cocoa/DataDetection.mm:210
> +    if (++indexIterator != resultIndices.end()) {

Oops this should just be a while loop; I will fix that.
Comment 10 Darin Adler 2021-05-09 18:23:50 PDT Comment hidden (obsolete)
Comment 11 Sam Weinig 2021-05-10 08:53:07 PDT
Comment on attachment 428143 [details]
Patch

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

> Source/WebCore/html/HTMLLIElement.cpp:122
> +    Optional<int> explicitValue;
> +    if (auto parsedValue = parseHTMLInteger(value))
> +        explicitValue = *parsedValue;

If we have this pattern more (convert Expected<T, *> to Optional<T> we should consider adding a makeOptional() or convertToOptional() that takes an Expected.
Comment 12 Darin Adler 2021-05-10 09:14:45 PDT
Comment on attachment 428143 [details]
Patch

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

>> Source/WebCore/html/HTMLLIElement.cpp:122
>> +        explicitValue = *parsedValue;
> 
> If we have this pattern more (convert Expected<T, *> to Optional<T> we should consider adding a makeOptional() or convertToOptional() that takes an Expected.

Or maybe that should be an implicit conversion defined in the Expected class template.
Comment 13 Darin Adler 2021-05-10 09:57:14 PDT
Committed r277269 (237536@main): <https://commits.webkit.org/237536@main>