Sort in-place to save time

This commit is contained in:
Gouvernathor 2023-11-14 23:34:14 +01:00
parent a606fc9ca2
commit 36d3a5d1a7

View File

@ -4,9 +4,9 @@ init python:
item = sorted(item, key=lambda x: natsort_key(x.name)) item = sorted(item, key=lambda x: natsort_key(x.name))
if sortby == "Price (Asc)": if sortby == "Price (Asc)":
item = sorted(item, key=lambda x: x.price, reverse=False) item.sort(key=lambda x: x.price, reverse=False)
elif current_sorting == "Price (Desc)": elif current_sorting == "Price (Desc)":
item = sorted(item, key=lambda x: x.price, reverse=True) item.sort(key=lambda x: x.price, reverse=True)
return item return item
label shop_item: label shop_item: