[Webkit-unassigned] [Bug 212714] Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 10 16:34:46 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=212714

--- Comment #25 from Geoffrey Garen <ggaren at apple.com> ---
> > Source/WebCore/rendering/RenderWidget.cpp:60
> > +        auto map = WTFMove(widgetNewParentMap());
> 
> In cases like this where we *rely* in the behavior that the source ends up
> empty afterward, instead of just allowing move as an optimization, we should
> write using std::exchange instead.
> 
>     auto map = std::exchange(widgetNewParentMap(), { });
> 
> The WTFMove form allows move as an optimization, but also allows the source
> map to have a remnant value other than empty. The std::exchange form
> guarantees that the source map will be empty. Both should generate nearly
> identical code if all the optimization is working properly.

+Chris because I think he has an opinion on move producing an empty value.

-- 
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/20200610/b1108a2a/attachment.htm>


More information about the webkit-unassigned mailing list