Bug 233145 - Decoder::unwrapForTesting() is unnecessarily inefficient
Summary: Decoder::unwrapForTesting() is unnecessarily inefficient
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-15 13:56 PST by Chris Dumez
Modified: 2021-11-16 08:59 PST (History)
6 users (show)

See Also:


Attachments
Patch (6.19 KB, patch)
2021-11-15 13:58 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.19 KB, patch)
2021-11-16 07:12 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-11-15 13:56:11 PST
Decoder::unwrapForTesting() is unnecessarily inefficient.
Comment 1 Chris Dumez 2021-11-15 13:58:53 PST
Created attachment 444303 [details]
Patch
Comment 2 Darin Adler 2021-11-15 17:49:27 PST
Comment on attachment 444303 [details]
Patch

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

> Source/WebKit/Platform/IPC/Decoder.cpp:146
> +    Vector<Attachment> attachments = std::exchange(decoder.m_attachments, { });

I would totally use auto here.

> Source/WebKit/Platform/IPC/Decoder.h:137
> +    std::optional<Attachment> takeAttachment();

Why isn’t this named takeLastAttachment? Is it obvious that the last one is the one to take?
Comment 3 Chris Dumez 2021-11-16 07:12:56 PST
Created attachment 444374 [details]
Patch
Comment 4 EWS 2021-11-16 08:58:02 PST
Committed r285866 (244292@main): <https://commits.webkit.org/244292@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444374 [details].
Comment 5 Radar WebKit Bug Importer 2021-11-16 08:59:33 PST
<rdar://problem/85460462>