Use ControlUtil.

This commit is contained in:
takezoe
2013-09-21 22:13:15 +09:00
parent 18ca3cbd80
commit e89b2020a3
14 changed files with 272 additions and 278 deletions

View File

@@ -33,5 +33,18 @@ object ControlUtil {
git.getRepository.close
}
def executeIf(condition: => Boolean)(action: => Unit): Boolean =
if(condition){
action
true
} else {
false
}
def optionIf[T](condition: => Boolean)(action: => Option[T]): Option[T] =
if(condition){
action
} else {
None
}
}