From be641919c8e7395ea38590be0de4d6b818ae3c72 Mon Sep 17 00:00:00 2001 From: shah Date: Fri, 13 Oct 2023 18:51:00 +0530 Subject: [PATCH] code optimize --- .../com/aws/amazonlocation/utils/Units.kt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/aws/amazonlocation/utils/Units.kt b/app/src/main/java/com/aws/amazonlocation/utils/Units.kt index 2c145fe8..891fe4b7 100644 --- a/app/src/main/java/com/aws/amazonlocation/utils/Units.kt +++ b/app/src/main/java/com/aws/amazonlocation/utils/Units.kt @@ -114,24 +114,24 @@ object Units { } } - if (mHours != 0L) { - mTime = if (mMinute != 0L) { - buildString { - append(mHours) - append(" ") - append(context.getString(R.string.label_hr)) - append(" ") - append(mTime) - } - } else { - buildString { - append(mHours) - append(" ") - append(context.getString(R.string.label_hr)) - } + if (mHours != 0L) { + mTime = if (mMinute != 0L) { + buildString { + append(mHours) + append(" ") + append(context.getString(R.string.label_hr)) + append(" ") + append(mTime) + } + } else { + buildString { + append(mHours) + append(" ") + append(context.getString(R.string.label_hr)) } } } + } return mTime }