mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
refactor UpdateQuality into switch statement
This commit is contained in:
parent
124578588e
commit
080b998176
@ -84,22 +84,15 @@ func UpdateQualityStandard(item *Item) {
|
||||
func UpdateQuality(items []*Item) {
|
||||
for i := 0; i < len(items); i++ {
|
||||
|
||||
if items[i].name == "Sulfuras, Hand of Ragnaros" {
|
||||
continue
|
||||
}
|
||||
|
||||
if items[i].name == "Aged Brie" {
|
||||
switch name := items[i].name; name {
|
||||
case "Sulfuras, Hand of Ragnaros":
|
||||
case "Aged Brie":
|
||||
UpdateQualityBrie(items[i])
|
||||
continue
|
||||
}
|
||||
|
||||
if items[i].name == "Backstage passes to a TAFKAL80ETC concert" {
|
||||
case "Backstage passes to a TAFKAL80ETC concert":
|
||||
UpdateQualityBackstagePasses(items[i])
|
||||
continue
|
||||
default:
|
||||
UpdateQualityStandard(items[i])
|
||||
}
|
||||
|
||||
UpdateQualityStandard(items[i])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user