Skip to content

Commit

Permalink
[#3490] Update ScopeMob Higher-order functions and lambdas to use lam…
Browse files Browse the repository at this point in the history
…bdas
  • Loading branch information
mustafaozhan committed May 30, 2024
1 parent acb665e commit 78d1b1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ internal class BillingManagerImpl(private val context: Context) :
billingClient.queryPurchaseHistoryAsync(queryPurchaseHistoryParams, this)

billingClient.whether(
{ isReady },
{ it.isReady },
{ billingResult.responseCode == BillingClient.BillingResponseCode.OK }
)?.apply {
val queryProductDetailsParams = QueryProductDetailsParams.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class AppConfigRepositoryImpl(
): Boolean? = updateConfigService.config
.whether(
{ !isAppUpdateShown },
{ updateLatestVersion > BuildKonfig.versionCode }
{ it.updateLatestVersion > BuildKonfig.versionCode }
)?.let {
it.updateForceVersion > BuildKonfig.versionCode
} ?: run { null } // do not show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class CalculatorViewModel(
private fun calculateOutput(input: String) = viewModelScope.launch {
val output = data.parser
.calculate(input.toSupportedCharacters(), MAXIMUM_FLOATING_POINT)
.mapTo { if (isFinite()) getFormatted(calculationStorage.precision) else "" }
.mapTo { if (it.isFinite()) it.getFormatted(calculationStorage.precision) else "" }

_state.update { copy(output = output) }

Expand Down Expand Up @@ -213,7 +213,7 @@ class CalculatorViewModel(
KEY_AC -> _state.update { copy(input = "") }
KEY_DEL ->
state.value.input
.whetherNot { isEmpty() }
.whetherNot { it.isEmpty() }
?.apply {
_state.update { copy(input = substring(0, length - 1)) }
}
Expand Down

0 comments on commit 78d1b1e

Please sign in to comment.