X-Git-Url: https://git.distorted.org.uk/~mdw/tripe-android/blobdiff_plain/a5ec891a1f3cbe4ae9aad5d2252f39b483ed543e..3bb2303d42adb3f37420f168b009ecfe64f888cd:/keys.scala diff --git a/keys.scala b/keys.scala index b9595ec..bdbede9 100644 --- a/keys.scala +++ b/keys.scala @@ -120,7 +120,7 @@ private val DEFAULTS: Seq[(String, Config => String)] = "sig-fresh" -> { _ => "always" }, "fingerprint-hash" -> { _("hash") }); -private def parseConfig(file: File): Config = { +private def parseConfig(file: File): HashMap[String, String] = { /* Build the new configuration in a temporary place. */ var m = HashMap[String, String](); @@ -131,7 +131,7 @@ private def parseConfig(file: File): Config = { for (line <- lines(in)) { line match { case RX_COMMENT() => ok; - case RX_KEYVAL(key, value) => m += key -> value; + case RX_KEYVAL(key, value) => m(key) = value; case _ => throw new ConfigSyntaxError(file.getPath, lno, "failed to parse line"); @@ -150,7 +150,7 @@ private def readConfig(file: File): Config = { /* Fill in defaults where things have been missed out. */ for ((key, dflt) <- DEFAULTS) { if (!(m contains key)) { - try { m += key -> dflt(m); } + try { m(key) = dflt(m); } catch { case e: DefaultFailed => throw new ConfigDefaultFailed(file.getPath, key,