提交 1759e721 编写于 作者: HansBug's avatar HansBug 😆

doc(hansbug): add 2 lines of comments for get and pop method in TreeStorage

上级 cc32aeaa
...@@ -22,6 +22,7 @@ cdef class TreeStorage: ...@@ -22,6 +22,7 @@ cdef class TreeStorage:
cpdef public void set(self, str key, object value) except *: cpdef public void set(self, str key, object value) except *:
self.map[key] = value self.map[key] = value
# get and get_or_default is designed separately due to the consideration of performance
cpdef public object get(self, str key): cpdef public object get(self, str key):
cdef object v, nv cdef object v, nv
try: try:
...@@ -35,6 +36,7 @@ cdef class TreeStorage: ...@@ -35,6 +36,7 @@ cdef class TreeStorage:
v = self.map.get(key, default) v = self.map.get(key, default)
return _c_undelay_check_data(self.map, key, v) return _c_undelay_check_data(self.map, key, v)
# pop and pop_or_default is designed separately due to the consideration of performance
cpdef public object pop(self, str key): cpdef public object pop(self, str key):
cdef object v, nv, res cdef object v, nv, res
try: try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册