mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Removed unnecessary caching operation of dbid.
This commit is contained in:
parent
bbb99a9c28
commit
f505e4959f
1 changed files with 2 additions and 7 deletions
|
|
@ -38,7 +38,6 @@ from evennia.typeclasses.tags import Tag, TagHandler, AliasHandler, PermissionHa
|
|||
|
||||
from evennia.utils.idmapper.models import SharedMemoryModel
|
||||
from evennia.utils.idmapper.base import SharedMemoryModelBase
|
||||
from evennia.server.caches import get_prop_cache, set_prop_cache
|
||||
#from evennia.server.caches import set_attr_cache
|
||||
|
||||
#from evennia.server.caches import call_ndb_hooks
|
||||
|
|
@ -269,11 +268,7 @@ class TypedObject(SharedMemoryModel):
|
|||
Caches and returns the unique id of the object.
|
||||
Use this instead of self.id, which is not cached.
|
||||
"""
|
||||
dbid = get_prop_cache(self, "_dbid")
|
||||
if not dbid:
|
||||
dbid = self.id
|
||||
set_prop_cache(self, "_dbid", dbid)
|
||||
return dbid
|
||||
return self.id
|
||||
|
||||
def __dbid_set(self, value):
|
||||
raise Exception("dbid cannot be set!")
|
||||
|
|
@ -287,7 +282,7 @@ class TypedObject(SharedMemoryModel):
|
|||
"""
|
||||
Returns the object's dbref on the form #NN.
|
||||
"""
|
||||
return "#%s" % self.dbid
|
||||
return "#%s" % self.id
|
||||
|
||||
def __dbref_set(self):
|
||||
raise Exception("dbref cannot be set!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue