Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)

This commit is contained in:
Raymond Hettinger 2002-06-30 03:39:14 +00:00
parent 78e057a32a
commit 46ac8eb3c8
11 changed files with 19 additions and 42 deletions

View file

@ -779,16 +779,14 @@ class Unmarshaller:
dispatch["name"] = end_string # struct keys are always strings
def end_array(self, data):
mark = self._marks[-1]
del self._marks[-1]
mark = self._marks.pop()
# map arrays to Python lists
self._stack[mark:] = [self._stack[mark:]]
self._value = 0
dispatch["array"] = end_array
def end_struct(self, data):
mark = self._marks[-1]
del self._marks[-1]
mark = self._marks.pop()
# map structs to Python dictionaries
dict = {}
items = self._stack[mark:]