From 5f93dc227463ac9a34bfe4d06b67b7d07bfb12cc Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Tue, 16 Mar 2010 21:51:39 -0700 Subject: [PATCH] Bullet.finished: Check vanished before checking actions, it's faster. --- bulletml/impl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bulletml/impl.py b/bulletml/impl.py index cc693e1..af3f153 100644 --- a/bulletml/impl.py +++ b/bulletml/impl.py @@ -264,10 +264,12 @@ class Bullet(object): @property def finished(self): """Check if this bullet is finished running.""" + if not self.vanished: + return False for action in self.actions: if not action.finished: return False - return self.vanished + return True def vanish(self): """Vanish this bullet and stop all actions.""" -- 2.30.2