[1/4] cmd: Avoid checking handle type when already known in WCMD_ReadFile

Eric Pouech eric.pouech at orange.fr
Tue Oct 4 14:29:05 CDT 2011

> I don't quite understand what you mean. WCMD_ReadFile is called
> directly/indirectly in a lot of places, mostly around line-by-line
> reads.
> The question is not whether the compiler will inline this function
> (you can't know that for sure, think -O0, different compilers, etc.),
> but whether you want to check that every time.
> This function is_console_handle() could be inlined or not/fast, but
> that's not the point. The point is why would one want to run that
> function when not necessary, i.e. when callers already know the type.
> It's just about finding/detecting the handle type once and only once
> (per handle).
the point is about passing twice the information to a given function
the point is about adding unnecessary enums that clutter all the code
the point is about thinking that you're only computing once a value, 
while you still
need to compare the handle type (as you added it) to a given number

Eric Pouech
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)

More information about the wine-devel mailing list