[webkit-dev] When to use "auto"? (I usually consider it harmful)

Antti Koivisto koivisto at iki.fi
Tue Jan 7 02:58:01 PST 2014


On Mon, Jan 6, 2014 at 11:49 PM, Geoffrey Garen <ggaren at apple.com> wrote:

>
> (2) ApplyStyleCommand.cpp:
>
>     auto children = elementChildren(*dummySpanAncestor);
>     for (auto child = children.begin(), end = children.end(); child !=
> end; ++child) {
> *        if (isSpanWithoutAttributesOrUnstyledStyleSpan(&*child))*
> *            toRemove.append(&*child);*
>     }
>

You are looking at a pretty old revision. In ToT this looks like

    for (auto& child : childrenOfType<Element>(*dummySpanAncestor)) {
        if (isSpanWithoutAttributesOrUnstyledStyleSpan(&child))
            toRemove.append(&child);
    }

  antti


>
> Thanks,
> Geoff
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140107/d136f5d5/attachment.html>


More information about the webkit-dev mailing list