From b280d1253c58b0e00593ca7684c089ea1ba5f2ee Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Wed, 17 Oct 2007 07:57:18 +0000 Subject: [PATCH] slight optimization in string handling on taskName and uniqueName --- direct/src/distributed/DistributedObject.py | 4 ++-- direct/src/distributed/DistributedObjectAI.py | 6 +++--- direct/src/distributed/DistributedObjectUD.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/direct/src/distributed/DistributedObject.py b/direct/src/distributed/DistributedObject.py index 6b022f7a8e..9b4d5e56ee 100644 --- a/direct/src/distributed/DistributedObject.py +++ b/direct/src/distributed/DistributedObject.py @@ -326,10 +326,10 @@ class DistributedObject(DistributedObjectBase, EnforcesCalldowns): self.cr.sendDeleteMsg(self.doId) def taskName(self, taskString): - return (taskString + "-" + str(self.getDoId())) + return ("%s-%s" % (taskString, self.doId)) def uniqueName(self, idString): - return (idString + "-" + str(self.getDoId())) + return ("%s-%s" % (idString, self.doId)) def getCallbackContext(self, callback, extraArgs = []): # Some objects implement a back-and-forth handshake operation diff --git a/direct/src/distributed/DistributedObjectAI.py b/direct/src/distributed/DistributedObjectAI.py index 7fdc4c3ac8..9b1f66aeb7 100644 --- a/direct/src/distributed/DistributedObjectAI.py +++ b/direct/src/distributed/DistributedObjectAI.py @@ -189,7 +189,7 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns): pass def addInterest(self, zoneId, note="", event=None): - self.air.addInterest(self.getDoId(), zoneId, note, event) + self.air.addInterest(self.doId, zoneId, note, event) def b_setLocation(self, parentId, zoneId): self.d_setLocation(parentId, zoneId) @@ -472,10 +472,10 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns): self._DOAI_requestedDelete = True def taskName(self, taskString): - return (taskString + "-" + str(self.getDoId())) + return ("%s-%s" % (taskString, self.doId)) def uniqueName(self, idString): - return (idString + "-" + str(self.getDoId())) + return ("%s-%s" % (idString, self.doId)) def validate(self, avId, bool, msg): if not bool: diff --git a/direct/src/distributed/DistributedObjectUD.py b/direct/src/distributed/DistributedObjectUD.py index c6b53c470b..f2dcdf9126 100755 --- a/direct/src/distributed/DistributedObjectUD.py +++ b/direct/src/distributed/DistributedObjectUD.py @@ -401,10 +401,10 @@ class DistributedObjectUD(DistributedObjectBase): self._DOUD_requestedDelete = True def taskName(self, taskString): - return (taskString + "-" + str(self.getDoId())) + return ("%s-%s" % (taskString, self.doId)) def uniqueName(self, idString): - return (idString + "-" + str(self.getDoId())) + return ("%s-%s" % (idString, self.doId)) def validate(self, avId, bool, msg): if not bool: