merge if else

This commit is contained in:
Karim Fadel 2026-01-14 08:31:19 +02:00
parent 74c809e44a
commit 48b98d08c0

View File

@ -19,23 +19,21 @@ class GildedRose {
if (item.sellIn < 0) { if (item.sellIn < 0) {
item.increaseQualityByOne(); item.increaseQualityByOne();
} }
} else if (item.isBackstagePasses()) {
item.increaseQualityBackstage();
item.decreaseSellInEachDay();
if (item.sellIn < 0) {
item.quality = 0;
}
} else { } else {
if (item.isBackstagePasses()) { item.decreaseQualityByOne();
item.increaseQualityBackstage();
item.decreaseSellInEachDay(); item.decreaseSellInEachDay();
if (item.sellIn < 0) { if (item.sellIn < 0) {
item.quality = 0;
}
} else {
item.decreaseQualityByOne(); item.decreaseQualityByOne();
item.decreaseSellInEachDay();
if (item.sellIn < 0) {
item.decreaseQualityByOne();
}
} }
} }
} }