r extract var

This commit is contained in:
Koleh David 2025-02-06 15:03:12 +10:30
parent 1a5d58df88
commit a5583e4129

View File

@ -9,10 +9,9 @@ class Item:
def update_item(item: Item):
if (
item.name != "Aged Brie"
and item.name != "Backstage passes to a TAFKAL80ETC concert"
):
is_aged_brie = item.name == "Aged Brie"
if not is_aged_brie and item.name != "Backstage passes to a TAFKAL80ETC concert":
if item.quality > 0:
if item.name != "Sulfuras, Hand of Ragnaros":
item.quality = item.quality - 1
@ -29,7 +28,7 @@ def update_item(item: Item):
if item.name != "Sulfuras, Hand of Ragnaros":
item.sell_in = item.sell_in - 1
if item.sell_in < 0:
if item.name != "Aged Brie":
if not is_aged_brie:
if item.name != "Backstage passes to a TAFKAL80ETC concert":
if item.quality > 0:
if item.name != "Sulfuras, Hand of Ragnaros":