Browse Source

Fixed my appending error. Now the new fortunes ...

... get prepended.

appending O(n)
prepending O(1)
Skamander 12 years ago
parent
commit
0ebb7d3449
1 changed files with 1 additions and 1 deletions
  1. 1 1
      play-scala/app/controllers/Application.scala

+ 1 - 1
play-scala/app/controllers/Application.scala

@@ -62,7 +62,7 @@ object Application extends Controller {
     Action {
       Async {
         Future(Fortune.getAll())(dbEc).map { fs =>
-          val fortunes =  fs :+ Fortune(anorm.NotAssigned, "Additional fortune added at request time.")
+          val fortunes =  Fortune(anorm.NotAssigned, "Additional fortune added at request time.") +: fs
           Ok(views.html.fortune(fortunes))
         }
       }