RE: Question on StringUtil.trim

2013-11-14 Thread Maurice Amsellem
Thanks Benoit. So it's slice that does the optimization. Maurice -Message d'origine- De : Benoit Wiart [mailto:b.wi...@ubik-ingenierie.com] Envoyé : jeudi 14 novembre 2013 09:03 À : dev@flex.apache.org Objet : Re: Question on StringUtil.trim I had the same question a few wee

Re: Question on StringUtil.trim

2013-11-14 Thread Benoit Wiart
I had the same question a few weeks ago And I think the fash sdk is optimized in this case as Scout didn't report any memory allocation Le 14 nov. 2013 à 05:33, Alex Harui a écrit : > > > On 11/13/13 8:23 PM, "labri...@digitalprimates.net" > wrote: > >>> No idea. I was trying to think of

Re: Question on StringUtil.trim

2013-11-13 Thread Alex Harui
On 11/13/13 8:23 PM, "labri...@digitalprimates.net" wrote: >>No idea. I was trying to think of any danger of manipulating the >>returned string if it is the original and not always a copy, but I can't >>think of anything off-hand. > >>Is it much faster to add the check and return the original?

RE: Question on StringUtil.trim

2013-11-13 Thread Michael A. Labriola
>No idea. I was trying to think of any danger of manipulating the returned >string if it is the original and not always a copy, but I can't think of >anything off-hand. >Is it much faster to add the check and return the original? Aren't AS strings immutable anyway? So, the method got a copy t

Re: Question on StringUtil.trim

2013-11-13 Thread Alex Harui
On 11/13/13 3:35 PM, "Maurice Amsellem" wrote: >Hi, > >I have noticed that trim will return a copy of the string argument even >if there are no spaces, instead of returning the original string. >Is that intended behavior (maybe for compatibility, or something ...) ? No idea. I was trying to

Question on StringUtil.trim

2013-11-13 Thread Maurice Amsellem
Hi, I have noticed that trim will return a copy of the string argument even if there are no spaces, instead of returning the original string. public static function trim(str:String):String { ... if (endIndex >= startIndex) return str.slice(startIndex, endIndex + 1); else