From acf7fbdd8776cc5665e157ec768a781585b68854 Mon Sep 17 00:00:00 2001 From: Koleh David Date: Thu, 6 Feb 2025 15:16:16 +1030 Subject: [PATCH] r guard clause and move backstage pass bool to top --- gilded_rose.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gilded_rose.py b/gilded_rose.py index a21e4d31..77876677 100755 --- a/gilded_rose.py +++ b/gilded_rose.py @@ -11,6 +11,7 @@ class Item: def update_item(item: Item): is_aged_brie = item.name == "Aged Brie" is_sulfuras = item.name == "Sulfuras, Hand of Ragnaros" + is_backstage_pass = item.name == "Backstage passes to a TAFKAL80ETC concert" if is_sulfuras: return @@ -22,10 +23,9 @@ def update_item(item: Item): if item.sell_in < 0: if item.quality < 50: item.quality = item.quality + 1 + return else: - is_backstage_pass = item.name == "Backstage passes to a TAFKAL80ETC concert" - if is_backstage_pass: if item.quality < 50: item.quality = item.quality + 1