Use slicing for getlayers for SettingsValue
This commit is contained in:
parent
65b99dab45
commit
313d6e3967
@ -64,11 +64,8 @@ class SettingValue:
|
|||||||
Args:
|
Args:
|
||||||
startlayer: The first layer to include.
|
startlayer: The first layer to include.
|
||||||
"""
|
"""
|
||||||
# FIXME this could be done more efficiently with a view.
|
|
||||||
idx = list(self._values.keys()).index(startlayer)
|
idx = list(self._values.keys()).index(startlayer)
|
||||||
d = self._values.copy()
|
d = OrderedDict(list(self._values.items())[idx:])
|
||||||
for _ in range(idx):
|
|
||||||
d.popitem(last=False)
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def get_first_value(self, startlayer=None):
|
def get_first_value(self, startlayer=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user