On Jan 6, 2014, at 1:49 PM, Geoffrey Garen <gga...@apple.com> wrote:

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

This should be written with a C++11 loop:

    for (auto& child : elementChildren(*dummySpanAncestor)) {
        if (isSpanWithoutAttributesOrUnstyledStyleSpan(&child))
            toRemove.append(&child);
    }

Not sure if you would say that helps or hurts readability. I could easily 
imagine either Element& or auto&; in cases like this where we don’t have to 
name the iterator type we don’t need auto as much as in the non-C++-11-loop 
where the iterator type strongly motivates it.

— Darin
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to