This looks like a pretty optimized function - no field accesses. Also, note how sprite isn't actually cast to anything before getting sent into the function, because it's already of type FlxSprite. This is the optimal situation.