From 4aac46f2bcb265fb2315211d366e9be73ed929eb Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Thu, 31 Aug 2017 01:58:00 +0200 Subject: [PATCH] Cleanup. (cherry picked from commit e7fe202) --- .../de/jotomo/ruffyscripter/commands/SetTbrCommand.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java index 33d33ed3c9..87af7d78ce 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java @@ -110,13 +110,9 @@ public class SetTbrCommand extends BaseCommand { log.debug("Current TBR %: " + currentPercent); long percentageChange = percentage - currentPercent; long percentageSteps = percentageChange / 10; - boolean increasePercentage = true; - if (percentageSteps < 0) { - increasePercentage = false; - percentageSteps = Math.abs(percentageSteps); - } + boolean increasePercentage = percentageSteps > 0; log.debug("Pressing " + (increasePercentage ? "up" : "down") + " " + percentageSteps + " times"); - for (int i = 0; i < percentageSteps; i++) { + for (int i = 0; i < Math.abs(percentageSteps); i++) { scripter.verifyMenuIsDisplayed(MenuType.TBR_SET); log.debug("Push #" + (i + 1)); if (increasePercentage) scripter.pressUpKey();