<duplicated code> eliminar condicional repetida

This commit is contained in:
Felipe Gaete 2024-08-18 23:41:07 -04:00
parent a55474f928
commit 0653eb8414

View File

@ -29,18 +29,14 @@ class GildedRose
increase_quality(item) increase_quality(item)
if item.name == "Backstage passes to a TAFKAL80ETC concert" if item.name == "Backstage passes to a TAFKAL80ETC concert"
if item.sell_in < 11 if item.sell_in < 11
if item.quality < 50
increase_quality(item) increase_quality(item)
end end
end
if item.sell_in < 6 if item.sell_in < 6
if item.quality < 50
increase_quality(item) increase_quality(item)
end end
end end
end end
end end
end
if not_legendary?(item) if not_legendary?(item)
item.sell_in = item.sell_in - 1 item.sell_in = item.sell_in - 1
end end