mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-22 07:43:06 +00:00
hashindex: simplify .pop
This commit is contained in:
parent
bdf2602e7c
commit
3c794fa980
1 changed files with 4 additions and 6 deletions
|
@ -141,13 +141,11 @@ class NSIndex1:
|
|||
|
||||
def pop(self, key, default=_NoDefault):
|
||||
try:
|
||||
value = self[key]
|
||||
del self[key]
|
||||
return value
|
||||
return self.ht.pop(key)
|
||||
except KeyError:
|
||||
if default != _NoDefault:
|
||||
return default
|
||||
raise
|
||||
if default is _NoDefault:
|
||||
raise
|
||||
return default
|
||||
|
||||
def iteritems(self, marker=None):
|
||||
do_yield = marker is None
|
||||
|
|
Loading…
Reference in a new issue