[Webkit-unassigned] [Bug 33189] scaleEmToUnits in SimpleFontDataMac.mm does an unnecessary division

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 4 18:13:11 PST 2010


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





--- Comment #8 from Ojan Vafai <ojan at chromium.org>  2010-01-04 18:13:11 PST ---
(In reply to comment #5)
> (From update of attachment 45849 [details])
> > -static inline float scaleEmToUnits(float x, unsigned unitsPerEm) { return x * (contextDPI / (contextDPI * unitsPerEm)); }
> > +static inline float scaleEmToUnits(float x, unsigned unitsPerEm) { return x / static_cast<float>(unitsPerEm); }
> 
> Why the static_cast<float>? As far as I know, C will do a float / unsigned just
> fine, and return a float without any cast.

I was just mimicking code used in the other platform's versions of
scaleEmToUnits. Removed.

-- 
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