Yes. That would be better (only 1.5KB), but only in this case. Assigning a null
value to a string should not covert it into an empty string.
I was suggesting to have an option to not do any conversions.
Right now my code works without any string conversion at all. This is because
of the “string-like” functions I added to XML and XMLList, as well as explicit
conversions in the beginning of my function calls:
public function getParaStyle(styleName:String):ParagraphStyle{
styleName = styleName.toString();
//etc.
}
This ensures that unknown data (which I happen to know is never null) will be
explicitly converted to a string before I start comparing it to other XML
objects.
On Aug 7, 2016, at 11:57 PM, Alex Harui <[email protected]> wrote:
>
>
> On 8/7/16, 12:09 PM, "Harbs" <[email protected]> wrote:
>
>> Sure.
>>
>> Here’s a couple of examples:
>>
>> f.leading = xml.Properties.Leading;
>> f.tracking = xml.@Tracking;
>>
>> I have 492 some assignments like this scattered across my code. Adding
>> toString() to every one of these would add 5412 bytes to the final
>> minified code. That’s not including non-XML assignments to string
>> variables (assuming there are).
>>
>> That’s not huge, but 5.4KB is significant. It also adds an extra function
>> call which makes stepping through code a bit more painful.
>
> I'm confused. Do these lines of code even work without toString() calls?
> What do you want the compiler to generate?
>
> Seems like the compiler could try generating:
>
> f.leading = "" + xml.Properties.Leading;
> f.tracking = "" + xml.@Tracking;
>
> Would that be any better?
>
>
> -Alex
>