slight optimization in string handling on taskName and uniqueName

This commit is contained in:
Joe Shochet 2007-10-17 07:57:18 +00:00
parent a20301a2b5
commit b280d1253c
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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:

View File

@ -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: