Code cleanup

dev
Laurent 7 years ago
parent 00b91bdf93
commit 9419990074
  1. 2
      app/src/main/java/net/pokeranalytics/android/model/realm/Result.kt
  2. 3
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -106,7 +106,7 @@ open class Result : RealmObject(), Filterable {
val transactionsSum = transactions.sumByDouble { it.amount } val transactionsSum = transactions.sumByDouble { it.amount }
val isLive = this.session?.bankroll?.live ?: true val isLive = this.session?.isLive ?: true
if (isLive) { if (isLive) {
val buyin = this.buyin ?: 0.0 val buyin = this.buyin ?: 0.0
val cashOut = this.cashout ?: 0.0 val cashOut = this.cashout ?: 0.0

@ -432,8 +432,7 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat
val numberOfHandsPerHour: Double val numberOfHandsPerHour: Double
get() { get() {
val tableSize = this.tableSize ?: 9 // 9 is the default table size if null val tableSize = this.tableSize ?: 9 // 9 is the default table size if null
val isLive = this.bankroll?.live ?: true val playerHandsPerHour = if (this.isLive) LIVE_PLAYER_HANDS_PER_HOUR else ONLINE_PLAYER_HANDS_PER_HOUR
val playerHandsPerHour = if (isLive) LIVE_PLAYER_HANDS_PER_HOUR else ONLINE_PLAYER_HANDS_PER_HOUR
return playerHandsPerHour / tableSize.toDouble() return playerHandsPerHour / tableSize.toDouble()
} }

Loading…
Cancel
Save