[PATCH] winex11: Avoid double initialization of variables in OpenGL functions.

Alex Henrie alexhenrie24 at gmail.com
Wed Nov 4 13:52:05 CST 2015


2015-11-04 12:22 GMT-07:00 Vincent Povirk <vincent at codeweavers.com>:
> Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
>
> Although I don't see anything wrong with 'get_render_type_from_fbconfig' as-is.

I moved the render_type = 0 assignment into a conditional branch. If
there was not a default case in that function already, it would not
have made a difference, because a jump instruction takes the same
amount of time or more as zeroing out a variable. But since we already
have the conditional, it makes more sense to move the initialization
into that conditional branch to avoid the cost of initializing the
variable unnecessarily.

-Alex



More information about the wine-patches mailing list