equal
deleted
inserted
replaced
1 object Application extends Controller { |
1 object Application extends Controller { |
2 |
2 |
3 def gt_cookie(c: Option[Cookie]) : Int = c match { |
3 def gt_cookie(c: Option[Cookie]) : Int = c.map(_.value) match { |
4 case Some(s) if (s.value.forall(_.isDigit)) => s.value.toInt |
4 case Some(s) if (s.forall(_.isDigit)) => s.toInt |
5 case _ => 0 |
5 case _ => 0 |
6 } |
6 } |
7 |
7 |
8 def mk_cookie(i: Int) : Cookie = { |
8 def mk_cookie(i: Int) : Cookie = { |
9 Cookie("visits", i.toString) |
9 Cookie("visits", i.toString) |