remove == true

This commit is contained in:
xuwei-k
2021-08-09 16:56:55 +09:00
parent 0fa2ccf107
commit 83f1f16de7
4 changed files with 7 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ object ProtectedBranchService {
pusher: String,
mergePullRequest: Boolean
)(implicit session: Session): Option[String] = {
if (mergePullRequest == true) {
if (mergePullRequest) {
None
} else {
checkBranchProtection(owner, repository, receivePack, command, pusher)

View File

@@ -38,7 +38,7 @@ trait OwnerAuthenticator { self: ControllerBase with RepositoryService with Acco
case Some(x) if (repository.owner == x.userName) => action(repository)
// TODO Repository management is allowed for only group managers?
case Some(x) if (getGroupMembers(repository.owner).exists { m =>
m.userName == x.userName && m.isManager == true
m.userName == x.userName && m.isManager
}) =>
action(repository)
case Some(x) if (getCollaboratorUserNames(userName, repoName, Seq(Role.ADMIN)).contains(x.userName)) =>

View File

@@ -41,7 +41,7 @@ class Mailer(settings: SystemSettings) {
htmlMsg: Option[String] = None,
loginAccount: Option[Account] = None
): Option[HtmlEmail] = {
if (settings.notification == true) {
if (settings.notification) {
settings.smtp.map { smtp =>
val email = new HtmlEmail
email.setHostName(smtp.host)
@@ -51,7 +51,7 @@ class Mailer(settings: SystemSettings) {
}
smtp.ssl.foreach { ssl =>
email.setSSLOnConnect(ssl)
if (ssl == true) {
if (ssl) {
email.setSslSmtpPort(smtp.port.get.toString)
}
}

View File

@@ -336,7 +336,7 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
)(implicit context: Context): Html = {
val avatarHtml = avatar(userName, size, tooltip, mailAddress)
val contentHtml = if (label == true) Html(avatarHtml.body + " " + userName) else avatarHtml
val contentHtml = if (label) Html(avatarHtml.body + " " + userName) else avatarHtml
userWithContent(userName, mailAddress)(contentHtml)
}
@@ -446,14 +446,14 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
}
result.append(c)
}
case '>' if tag == true => {
case '>' if tag => {
tag = false
result.append(c)
}
case _ if tag == false => {
text.append(c)
}
case _ if tag == true => {
case _ if tag => {
result.append(c)
}
}