mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)
This commit is contained in:
parent
78e057a32a
commit
46ac8eb3c8
11 changed files with 19 additions and 42 deletions
|
@ -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:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue