mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-17 03:15:04 +00:00
Swift: Apply AppCode inspection "unnecessary parentheses"
This commit is contained in:
2 files changed
+17
-17
No files matched your search
@@ -7,25 +7,25 @@ public class GildedRose {
|
||||
|
||||
public func updateQuality() {
|
||||
for i in 0 ..< items.count {
|
||||
if (items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (items[i].quality > 0) {
|
||||
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
|
||||
if items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert" {
|
||||
if items[i].quality > 0 {
|
||||
if items[i].name != "Sulfuras, Hand of Ragnaros" {
|
||||
items[i].quality = items[i].quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
if items[i].quality < 50 {
|
||||
items[i].quality = items[i].quality + 1
|
||||
|
||||
if (items[i].name == "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (items[i].sellIn < 11) {
|
||||
if (items[i].quality < 50) {
|
||||
if items[i].name == "Backstage passes to a TAFKAL80ETC concert" {
|
||||
if items[i].sellIn < 11 {
|
||||
if items[i].quality < 50 {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 6) {
|
||||
if (items[i].quality < 50) {
|
||||
if items[i].sellIn < 6 {
|
||||
if items[i].quality < 50 {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
@@ -33,15 +33,15 @@ public class GildedRose {
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
|
||||
if items[i].name != "Sulfuras, Hand of Ragnaros" {
|
||||
items[i].sellIn = items[i].sellIn - 1
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 0) {
|
||||
if (items[i].name != "Aged Brie") {
|
||||
if (items[i].name != "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (items[i].quality > 0) {
|
||||
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
|
||||
if items[i].sellIn < 0 {
|
||||
if items[i].name != "Aged Brie" {
|
||||
if items[i].name != "Backstage passes to a TAFKAL80ETC concert" {
|
||||
if items[i].quality > 0 {
|
||||
if items[i].name != "Sulfuras, Hand of Ragnaros" {
|
||||
items[i].quality = items[i].quality - 1
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class GildedRose {
|
||||
items[i].quality = items[i].quality - items[i].quality
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
if items[i].quality < 50 {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user