AS3: Performance question calling an event function with null param
- by adehaas
Lately I needed to call a listener function without an actual listener like so:
foo(null);
private function foo(event:Event):void
{
//do something
}
So I was wondering if there is a significant difference regarding performance between this and using the following, in which I can prevent the null in calling the function without the listener, but am still able to call it with a listener as well:
foo();
private function foo(event:Event = null):void
{
}
I am not sure wether it is just a question of style, or actually bad practice and I should write two similar functions, one with and one without the event param (which seems cumbersome to me).
Looking forward to your opinions, thx.