mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +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) {
|
func UpdateQuality(items []*Item) {
|
||||||
for i := 0; i < len(items); i++ {
|
for i := 0; i < len(items); i++ {
|
||||||
|
|
||||||
if items[i].name == "Sulfuras, Hand of Ragnaros" {
|
switch name := items[i].name; name {
|
||||||
continue
|
case "Sulfuras, Hand of Ragnaros":
|
||||||
}
|
case "Aged Brie":
|
||||||
|
|
||||||
if items[i].name == "Aged Brie" {
|
|
||||||
UpdateQualityBrie(items[i])
|
UpdateQualityBrie(items[i])
|
||||||
continue
|
case "Backstage passes to a TAFKAL80ETC concert":
|
||||||
}
|
|
||||||
|
|
||||||
if items[i].name == "Backstage passes to a TAFKAL80ETC concert" {
|
|
||||||
UpdateQualityBackstagePasses(items[i])
|
UpdateQualityBackstagePasses(items[i])
|
||||||
continue
|
default:
|
||||||
|
UpdateQualityStandard(items[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateQualityStandard(items[i])
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user