Bullet.finished: Check vanished before checking actions, it's faster.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 17 Mar 2010 04:51:39 +0000 (21:51 -0700)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 17 Mar 2010 04:51:39 +0000 (21:51 -0700)
bulletml/impl.py

index cc693e1..af3f153 100644 (file)
@@ -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."""