else
Made popping like a million times faster because I was dumb before.
This commit is contained in:
parent
54515138fc
commit
379462534c
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ class Stack:
|
|||
if len(self) == 0:
|
||||
raise StackError("Cannot pop from empty Stack")
|
||||
lastitem = self.data[-1]
|
||||
self.data = self.data[:-1]
|
||||
del self.data[-1]
|
||||
return lastitem
|
||||
|
||||
def populate(self, itemlist, destructive=False):
|
||||
|
@ -122,4 +122,4 @@ class Stack:
|
|||
returns None
|
||||
"""
|
||||
self.data = self.data[:value]
|
||||
self.maxlen = value
|
||||
self.maxlen = value
|
||||
|
|
Loading…
Reference in a new issue