mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
Swift: Apply AppCode inspection "unnecessary parentheses"
This commit is contained in:
parent
b66c0d9f3c
commit
f82c067544
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ let items = [
|
||||
let app = GildedRose(items: items);
|
||||
|
||||
var days = 2;
|
||||
if (CommandLine.argc > 1) {
|
||||
if CommandLine.argc > 1 {
|
||||
days = Int(CommandLine.arguments[1])! + 1
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user