app2.scala
changeset 7 bd2b16f82601
parent 6 4c40d4b2d01c
--- a/app2.scala	Tue Sep 25 01:32:01 2012 +0100
+++ b/app2.scala	Tue Sep 25 02:25:56 2012 +0100
@@ -1,7 +1,7 @@
 object Application extends Controller {
 
-  def gt_cookie(c: Option[Cookie]) : Int = c match {
-    case Some(s) if (s.value.forall(_.isDigit)) => s.value.toInt 
+  def gt_cookie(c: Option[Cookie]) : Int = c.map(_.value) match {
+    case Some(s) if (s.forall(_.isDigit)) => s.toInt 
     case _ => 0
   }