Bug 125001 - [WebGL] Unnecessary condition check in the while loop
Summary: [WebGL] Unnecessary condition check in the while loop
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-28 23:18 PST by Przemyslaw Szymanski
Modified: 2015-05-11 03:42 PDT (History)
8 users (show)

See Also:


Attachments
patch (1.72 KB, patch)
2013-11-29 02:39 PST, Przemyslaw Szymanski
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Przemyslaw Szymanski 2013-11-28 23:18:49 PST
In this situation a while loop needs to make an unnecessary check at the begining. This loop is designed to make at least one iteration. In this case a better option is to use do-while. And it is also a good practice not to make such code.
Comment 1 Przemyslaw Szymanski 2013-11-29 02:39:37 PST
Created attachment 218047 [details]
patch
Comment 2 Brent Fulgham 2014-01-09 19:36:30 PST
For the simple boolean test, I doubt this has much benefit. Did you do some profiling that showed this as a hotspot?

I think your code is probably more correct, but I'm not sure it's worth changing at this point.
Comment 3 WebKit Commit Bot 2015-05-11 03:42:49 PDT
Comment on attachment 218047 [details]
patch

Clearing flags on attachment: 218047

Committed r184073: <http://trac.webkit.org/changeset/184073>
Comment 4 WebKit Commit Bot 2015-05-11 03:42:53 PDT
All reviewed patches have been landed.  Closing bug.