Hi, On Mon, Aug 14, 2006 at 06:49:00PM +1000, Jeff Latimer wrote: > Dmitry Timoshkov wrote: > >I'd suggest to move GetTextMetricsW outside of the loop to not kill > >the performance. > > I put it inside the loop as I assumed that a non existent glyph would > be relatively rare and the call would not happen much. This seemed > preferable to doing the call every time the function was called.
This should have gone into a comment right there because it's a very normal reaction to immediately question code like that, so the code should properly defend itself by default ;) IOW just the usual "do coding as obvious as possible, then properly comment everything else that isn't obvious". Maybe something like /* called in a loop, but missing glyph shouldn't happen often so we don't want to call it outside the loop, always */ Andreas Mohr