From f903b83315edeeb2dc84ee8dd0c0906976c56caa Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Mon, 28 Aug 2017 20:32:41 +0200 Subject: [PATCH] Simplify. --- .../de/jotomo/ruffyscripter/commands/SetTbrCommand.java | 8 +++----- 1 file changed, 3 insertions(+), 5 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 eea2df52c7..206e27ba9e 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java @@ -181,11 +181,9 @@ public class SetTbrCommand extends BaseCommand { long durationSteps = difference / 15; long durationAfterInitialSteps = currentDuration + (durationSteps * 15); - long finalSteps = durationSteps; - if (durationAfterInitialSteps < duration) finalSteps++; - else if (durationAfterInitialSteps > duration) finalSteps--; - - return finalSteps; + if (durationAfterInitialSteps < duration) return durationSteps + 1; + else if (durationAfterInitialSteps > duration) return durationSteps - 1; + else return durationSteps; } private void verifyDisplayedTbrDuration(boolean increasingPercentage) {