Skip to content

Commit

Permalink
code optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
shah272728 committed Oct 13, 2023
1 parent 7140f4e commit be64191
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions app/src/main/java/com/aws/amazonlocation/utils/Units.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit be64191

Please sign in to comment.