From ff44437706bc5eb34582329db869c2031772954e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 18 Aug 2020 19:29:51 +0200 Subject: [PATCH] Extract method for marking cheese --- .../Preprocessing/StaminaCheeseDetector.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs b/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs index e1dad70d90..3f952d8317 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs @@ -48,10 +48,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing if (repeatedLength < roll_min_repetitions) continue; - for (int j = repetitionStart; j < i; j++) - { - hitObjects[j].StaminaCheese = true; - } + markObjectsAsCheese(repetitionStart, i); } } @@ -80,11 +77,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing if (tlLength < tl_min_repetitions) continue; - for (int j = Math.Max(0, i - tlLength); j < i; j++) - { - hitObjects[j].StaminaCheese = true; - } + markObjectsAsCheese(Math.Max(0, i - tlLength), i); } } + + private void markObjectsAsCheese(int start, int end) + { + for (int i = start; i < end; ++i) + hitObjects[i].StaminaCheese = true; + } } }