File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,18 @@ class CreditTransactionService @Inject()(creditTransactionDAO: CreditTransaction
7676 // with milliCreditDelta == 0 so the caller can filter them out.
7777 def compactFreeCreditsForDisplay (transactions : List [CreditTransaction ]): List [CreditTransaction ] = {
7878 val revocationByGrantId : Map [ObjectId , CreditTransaction ] =
79- transactions
80- .filter(_.creditState == CreditState .Revoking )
81- .flatMap(t => t._relatedTransaction.map(_ -> t))
82- .toMap
79+ transactions.filter(_.creditState == CreditState .Revoking ).flatMap(t => t._relatedTransaction.map(_ -> t)).toMap
8380 val revocationIds : Set [ObjectId ] = revocationByGrantId.values.map(_._id).toSet
8481 transactions
8582 .filterNot(t => revocationIds.contains(t._id))
8683 .map(t =>
8784 revocationByGrantId.get(t._id) match {
88- case Some (revocation) => t.copy(milliCreditDelta = t.milliCreditDelta + revocation.milliCreditDelta, comment = s " ${t.comment}: ${(t.milliCreditDelta + revocation.milliCreditDelta) / 1000.0 } used " )
89- case None => t
85+ case Some (revocation) =>
86+ t.copy(
87+ milliCreditDelta = t.milliCreditDelta + revocation.milliCreditDelta,
88+ comment = s " ${t.comment}: ${(t.milliCreditDelta + revocation.milliCreditDelta) / 1000.0 } used "
89+ )
90+ case None => t
9091 })
9192 }
9293
You can’t perform that action at this time.
0 commit comments