home · contact · privacy
Simplify code.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 9 Jul 2020 23:07:31 +0000 (01:07 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 9 Jul 2020 23:07:31 +0000 (01:07 +0200)
new/plomrogue/game.py

index ffedbfaff14200e0af6a4f2335af5b5e0f66448b..7275ce944ee7a7563d015b0b2adeb7c3ed6776b5 100755 (executable)
@@ -175,7 +175,7 @@ class Game(GameBase):
 
         def task_prefixed(command_name, task_prefix, task_command,
                           argtypes_prefix=None):
-            if command_name[:len(task_prefix)] == task_prefix:
+            if command_name.startswith(task_prefix):
                 task_name = command_name[len(task_prefix):]
                 if task_name in self.tasks:
                     f = partial_with_attrs(task_command, task_name, self)