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) {
item.increaseQualityByOne();
}
} else if (item.isBackstagePasses()) {
item.increaseQualityBackstage();
item.decreaseSellInEachDay();
if (item.sellIn < 0) {
item.quality = 0;
}
} else {
if (item.isBackstagePasses()) {
item.increaseQualityBackstage();
item.decreaseQualityByOne();
item.decreaseSellInEachDay();
item.decreaseSellInEachDay();
if (item.sellIn < 0) {
item.quality = 0;
}
} else {
if (item.sellIn < 0) {
item.decreaseQualityByOne();
item.decreaseSellInEachDay();
if (item.sellIn < 0) {
item.decreaseQualityByOne();
}
}
}
}