progs/app2.scala
changeset 96 9fcd3de53c06
parent 93 4794759139ea
child 97 60a3ba90dd53
--- a/progs/app2.scala	Tue Sep 24 01:12:36 2013 +0100
+++ b/progs/app2.scala	Tue Sep 24 01:56:53 2013 +0100
@@ -3,13 +3,13 @@
 def unquote(s: String) = s.drop(1).dropRight(1)
 
 def get_all_URLs(page: String) : Set[String] = {
-  (http_pattern.findAllIn(page)).map { unquote(_) }.toSet
+  http_pattern.findAllIn(page).map(unquote).toSet
 }
 
 def crawl(url: String, n: Int) : Unit = {
   if (n == 0) ()
   else {
-    println("Visiting: " + n + " " + url)
+    println(s"Visiting: $n $url")
     for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1)
   }
 }