From 6443502808e8a21d4539ad2b6bf1b29cedbb7c8a Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Fri, 2 Mar 2018 16:41:25 +0200 Subject: [PATCH] reduced if...else to single line as Adrian suggested --- .../plugins/Overview/Dialogs/NewCarbsDialog.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java index 5e2a811dbb..9ecf426a72 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java @@ -260,13 +260,9 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, D Profile currentProfile = MainApp.getConfigBuilder().getProfile(); if(currentProfile == null) return; - if(currentProfile.getUnits().equals(Constants.MMOL)) { - esTT = eatingSoonTT > 0 ? Profile.toMgdl(eatingSoonTT,Constants.MMOL) : 90d; - activityTT = prefTT > 0 ? Profile.toMgdl(prefTT,Constants.MMOL) : 140d; - } else { - esTT = eatingSoonTT > 0 ? eatingSoonTT : 90d; - activityTT = prefTT > 0 ? prefTT : 140d; - } + + esTT = eatingSoonTT > 0 ? Profile.toMgdl(eatingSoonTT,currentProfile.getUnits()) : 90d; + activityTT = prefTT > 0 ? Profile.toMgdl(prefTT,currentProfile.getUnits()) : 140d; if (startActivityTTCheckbox.isChecked()) { if(currentProfile.getUnits().equals(Constants.MMOL)) {