From ddae445fec2f576b5a0684f23c625b477eadad0e Mon Sep 17 00:00:00 2001 From: Chamoda Ranasinghe Date: Tue, 16 Jan 2024 03:45:48 +0700 Subject: [PATCH] cleared the updateSulfurasItem without affecting the test results --- TypeScript/app/gilded-rose.ts | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/TypeScript/app/gilded-rose.ts b/TypeScript/app/gilded-rose.ts index 26d3936b..d7c8c005 100644 --- a/TypeScript/app/gilded-rose.ts +++ b/TypeScript/app/gilded-rose.ts @@ -56,15 +56,15 @@ export class GildedRose { private updateSulfurasItem(item: Item) { assert(item.name == ItemNames.SULFURAS); - if (item.quality > 0 && item.name != ItemNames.SULFURAS) { - item.quality = item.quality - 1; - } - if (item.sellIn < 0 && item.quality < MAX_ITEM_QUALITY) { - item.quality = item.quality + 1; - } + // this function does not update the item (tests are still passing without any logic in this function) } private updateNormalItem(item: Item) { + assert( + item.name != ItemNames.AGED_BRIE && + item.name != ItemNames.BACKSTAGE_PASSES && + item.name != ItemNames.SULFURAS + ); if ( item.name != ItemNames.AGED_BRIE && item.name != ItemNames.BACKSTAGE_PASSES @@ -76,18 +76,6 @@ export class GildedRose { } } else if (item.quality < MAX_ITEM_QUALITY) { item.quality = item.quality + 1; - if (item.name == ItemNames.BACKSTAGE_PASSES) { - if (item.sellIn < 11) { - if (item.quality < MAX_ITEM_QUALITY) { - item.quality = item.quality + 1; - } - } - if (item.sellIn < 6) { - if (item.quality < MAX_ITEM_QUALITY) { - item.quality = item.quality + 1; - } - } - } } if (item.name != ItemNames.SULFURAS) { item.sellIn = item.sellIn - 1;