mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 09:55:49 +01:00
use count instead of "filter().length"
This commit is contained in:
@@ -111,7 +111,7 @@ trait IssuesService {
|
|||||||
val (_, cs) = status.head
|
val (_, cs) = status.head
|
||||||
Some(CommitStatusInfo(
|
Some(CommitStatusInfo(
|
||||||
count = status.length,
|
count = status.length,
|
||||||
successCount = status.filter(_._2.state == CommitState.SUCCESS).length,
|
successCount = status.count(_._2.state == CommitState.SUCCESS),
|
||||||
context = (if(status.length == 1) Some(cs.context) else None),
|
context = (if(status.length == 1) Some(cs.context) else None),
|
||||||
state = (if(status.length == 1) Some(cs.state) else None),
|
state = (if(status.length == 1) Some(cs.state) else None),
|
||||||
targetUrl = (if(status.length == 1) cs.targetUrl else None),
|
targetUrl = (if(status.length == 1) cs.targetUrl else None),
|
||||||
|
|||||||
Reference in New Issue
Block a user