diff --git a/src/main/scala/service/IssuesService.scala b/src/main/scala/service/IssuesService.scala index 8dde330..f0b6ebd 100644 --- a/src/main/scala/service/IssuesService.scala +++ b/src/main/scala/service/IssuesService.scala @@ -49,12 +49,8 @@ * @return the count of the search result */ def countIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean, - repos: (String, String)*): Int = { - // TODO It must be _.length instead of map (_.issueId) list).length. - // But it does not work on Slick 1.0.1 (worked on Slick 1.0.0). - // https://github.com/slick/slick/issues/170 - (searchIssueQuery(repos, condition, filterUser, onlyPullRequest) map (_.issueId) list).length - } + repos: (String, String)*): Int = + Query(searchIssueQuery(repos, condition, filterUser, onlyPullRequest).length).first /** * Returns the Map which contains issue count for each labels. * diff --git a/src/main/scala/service/RepositoryService.scala b/src/main/scala/service/RepositoryService.scala index 1c98458..a443b81 100644 --- a/src/main/scala/service/RepositoryService.scala +++ b/src/main/scala/service/RepositoryService.scala @@ -201,13 +201,10 @@ } } - // TODO It must be _.length instead of map (_.issueId) list).length. - // But it does not work on Slick 1.0.1 (worked on Slick 1.0.0). - // https://github.com/slick/slick/issues/170 private def getForkedCount(userName: String, repositoryName: String): Int = - Query(Repositories).filter { t => + Query(Repositories.filter { t => (t.originUserName is userName.bind) && (t.originRepositoryName is repositoryName.bind) - }.list.length + }.length).first def getForkedRepositories(userName: String, repositoryName: String): List[String] =