The older code works, but this code uses less memory.

Greg added an optimization to use String class instances instead of literals. 
That optimization undid an older optimization of not writing the default 
nodeKinds.

Reverting to default literals on the prototype saved a couple of MB of memory 
in my app.

> On Nov 28, 2019, at 7:00 PM, Alex Harui <[email protected]> wrote:
> 
> Is this a temporary workaround? Shouldn't the old code work?
> 
> Get Outlook for Android<https://aka.ms/ghei36>
> 
> ________________________________
> From: [email protected] <[email protected]>
> Sent: Thursday, November 28, 2019 8:50:10 AM
> To: [email protected] <[email protected]>
> Subject: [royale-asjs] branch develop updated: string literals are not set in 
> the constructor
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> harbs pushed a commit to branch develop
> in repository 
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C5e9143c74afb4b2e0cd308d7742308d4%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637105566130549447&amp;sdata=gvTjl3kQ2I04ghkuwarZ7VBaGLXXdWMbA74WFfptQik%3D&amp;reserved=0
> 
> 
> The following commit(s) were added to refs/heads/develop by this push:
>     new 265c230  string literals are not set in the constructor
> 265c230 is described below
> 
> commit 265c230ac5d555b2643bb9220bb5b69408abd66d
> Author: Harbs <[email protected]>
> AuthorDate: Thu Nov 28 18:49:50 2019 +0200
> 
>    string literals are not set in the constructor
> 
>    The string literal will work because the comparison is not strict
> ---
> frameworks/projects/XML/src/main/royale/XML.as | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/frameworks/projects/XML/src/main/royale/XML.as 
> b/frameworks/projects/XML/src/main/royale/XML.as
> index 8bdc99e..2ecd067 100644
> --- a/frameworks/projects/XML/src/main/royale/XML.as
> +++ b/frameworks/projects/XML/src/main/royale/XML.as
> @@ -906,7 +906,7 @@ package
>                                 if (lastChild && lastChild._nodeKind == 
> ELEMENT) {
> 
>                                         const wrapper:XML = new XML();
> -                                       wrapper._nodeKind = ELEMENT;
> +                                       // wrapper._nodeKind = ELEMENT;
>                                         child = new XML(child.toString());
>                                         wrapper.setName(lastChild.name());
>                                         child.setParent(wrapper);
> @@ -1169,7 +1169,7 @@ package
>                         */
>                         var i:int;
>                         var xml:XML = new XML();
> -                       xml._nodeKind = _nodeKind;
> +                       xml.setNodeKind(_nodeKind);
>                         xml.setName(name());
>                         xml.setValue(_value);
>                         var len:int;
> @@ -1872,7 +1872,7 @@ package
>                         return declaredNS;
>                 }
> 
> -               private var _nodeKind:String = ELEMENT;
> +               private var _nodeKind:String = "element";
>                 /**
>                  * Specifies the type of node: text, comment, 
> processing-instruction, attribute, or element.
>                  * @return
> 

Reply via email to