Skip to content

AbstractOrderedObject.as bug and optimisation #7

@jeromedecoster

Description

@jeromedecoster

Hello,

I think the $deleteProperty doesn't work:
http://github.com/theflashbum/fcss/blob/master/src/com/flashartofwar/fcss/objects/AbstractOrderedObject.as#L117

I suggest you :
flash_proxy override function $deleteProperty(name:*):Boolean
{
var s:String = name;
var has:Boolean = properties.hasOwnProperty(s);
if (has)
{
delete properties[s];
propertiesIndex.splice(propertiesIndex.indexOf(s), 1);
}
return has;
}

//

The setProperty method can be optimize:
http://github.com/theflashbum/fcss/blob/master/src/com/flashartofwar/fcss/objects/AbstractOrderedObject.as#L133

I suggest you :
flash_proxy override function setProperty(name:, value:):void
{
var s:String = name;
if (!properties.hasOwnProperty(s))
propertiesIndex[propertiesIndex.length] = s;

properties[s] = value;

}

//

The nextName and nextValue method can be optimize too:
http://github.com/theflashbum/fcss/blob/master/src/com/flashartofwar/fcss/objects/AbstractOrderedObject.as#L202

I suggest to use "int" :
flash_proxy override function nextValue(index:int):*
{
return properties[propertiesIndex[int(index - 1)]];
}

Bye !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions