Browse Source
fix OrderedDictWithIndex
setitem() would modify the dict of the class. oops.
3.3.3.1
SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
1 deletions
-
electrum/util.py
|
|
@ -1007,7 +1007,9 @@ class OrderedDictWithIndex(OrderedDict): |
|
|
|
Note: very inefficient to modify contents, except to add new items. |
|
|
|
""" |
|
|
|
|
|
|
|
_key_to_pos = {} |
|
|
|
def __init__(self): |
|
|
|
super().__init__() |
|
|
|
self._key_to_pos = {} |
|
|
|
|
|
|
|
def _recalc_key_to_pos(self): |
|
|
|
self._key_to_pos = {key: pos for (pos, key) in enumerate(self.keys())} |
|
|
|