use count instead of "filter().length"

This commit is contained in:
xuwei-k
2017-04-02 15:32:07 +09:00
parent 5eb41d5b25
commit cfae6d76b2

View File

@@ -111,7 +111,7 @@ trait IssuesService {
val (_, cs) = status.head
Some(CommitStatusInfo(
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),
state = (if(status.length == 1) Some(cs.state) else None),
targetUrl = (if(status.length == 1) cs.targetUrl else None),