[Webkit-unassigned] [Bug 103006] [EFL][WK2] Missing the routine to check the validation for workqueue

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 23 04:22:33 PST 2012


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





--- Comment #33 from Jongseok Yang <js45.yang at samsung.com>  2012-11-23 04:24:35 PST ---
(In reply to comment #30)
> (In reply to comment #29)
> > (In reply to comment #28)
> > > (From update of attachment 175761 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=175761&action=review
> > > 
> > > >>>>> Source/WebKit2/Platform/efl/WorkQueueEfl.cpp:85
> > > >>>>> +        for (size_t i = 0; i < workItemQueue.size(); ++i) {
> > > >>>> 
> > > >>>> Please cache workItemQueue.size() before the loop.
> > > >>> 
> > > >>> Could you explain why it is required?
> > > >> 
> > > >> This is WebKit coding style and this makes sure that the queue size is not retrieved (possibly computed) for every iteration of the loop.
> > > > 
> > > > Is it WebKit coding style? There are so many uses like the style in WebKit.
> > > 
> > > From http://www.webkit.org/coding/coding-style.html:
> > > size_t frameViewsCount = frameViews.size();
> > > for (size_t i = i; i < frameViewsCount; ++i)
> > >     frameViews[i]->updateLayoutAndStyleIfNeededRecursive();
> > > 
> > 
> > Could check the title for your example?
> > "Prefer index over iterator in Vector iterations for a terse, easier-to-read code."
> > As I think, it means that index style "[i]" is recommended instead of iterator style "::iterator", ".begin()".
> 
> Yes, I know the section title is about a different matter. It still show that code in the style guide (which is supposed to be good reference) is caching the container size before the loop. This is common practice in WebKit code base (at least for new patches). This is good practice too.
> 
> I'm not going to discuss this further since it is a style issue. I really hope the patch lands with the right style though (confirm with Gyuyoung if needed).

Thanks for your review. I appreciate it.
size() in Vector returns just the member variable, not computed.
"size_t size() const { return m_size; }" in Vector.h
So, it's unnecessary like your comment "we try to avoid useless temporary variables in WebKit."

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list