[webkit-reviews] review granted: [Bug 70285] Style guide should mention the preference of index over iterator : [Attachment 111690] Updated per comment

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 21 14:57:44 PDT 2011


Darin Adler <darin at apple.com> has granted Ryosuke Niwa <rniwa at webkit.org>'s
request for review:
Bug 70285: Style guide should mention the preference of index over iterator
https://bugs.webkit.org/show_bug.cgi?id=70285

Attachment 111690: Updated per comment
https://bugs.webkit.org/attachment.cgi?id=111690&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=111690&action=review


> Websites/webkit.org/coding/coding-style.html:712
> +<li>Prefer index over iterator in Vector iterations for a terse,
easier-to-read code, and to avoid accessing freed memory

I don’t see the end of this <li> element.

It’s overselling this technique to say that it avoids accessing freed memory,
because using a too high index can still access freed memory.

> Websites/webkit.org/coding/coding-style.html:717
> +size_t frameViewSize = frameViews.size();

frameViewSize is not the right name here. Maybe frameViewsSize or
frameViewsCount or size or count.


More information about the webkit-reviews mailing list