flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Re: ADG Bug of the day
Date Tue, 11 Mar 2014 06:43:13 GMT

> At Adobe, the policy was GIGO (Garbage In, Garbage Out).  If you provide
> values outside of the allowed values, we did not promise anything
> reasonable would happen and we generally did no check the values assigned.
> Do we want to switch to a policy to fatten and slow down the SDK with
> input checking?

In this case doing a check against  undefined is probable faster and IMO more clearly states
what is going on.

if (c.headerWordWrap == undefined)
	return headerWordWrap;
	return c.headerWordWrap;

That's one check and one property lookup if it's undefined or one check and two property lookups
if not.

       if (c.wordWrap == true)
           return true;
       if (c.wordWrap == false)
           return false;

       return wordWrap;

That's two checks and two property lookups if it's undefined or one or two checks and one
or two property lookups if not.

View raw message