Thanks for the clarification, Darin.

Can we add this preference on the style guide for the future reference?

- Ryosuke

On Mon, Oct 17, 2011 at 4:25 PM, Darin Adler <[email protected]> wrote:

> We prefer index style. In the past I believe we could not measure a
> difference in performance.
>
> One benefit of the index style is that it is more terse, and often easier
> to read than the iterator style, which requires repeating the type name
> twice to declare the start and end value of the vector.
>
> Another benefit of the index style is that it behaves predictably if
> elements are added to the vector while iterating it. The pointer style can
> easily end up accessing freed memory.
>
> A benefit of the pointer style is that it could theoretically be faster
> because there is no need to refetch the vector base address.
>
>    -- Darin
>
> _______________________________________________
> webkit-dev mailing list
> [email protected]
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to