Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractOrderedObject.as bug and optimisation #7

Open
jeromedecoster opened this issue Feb 28, 2010 · 0 comments
Open

AbstractOrderedObject.as bug and optimisation #7

jeromedecoster opened this issue Feb 28, 2010 · 0 comments

Comments

@jeromedecoster
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant