diff options
Diffstat (limited to 'src/main/scala/spray/json/JsonParser.scala')
-rw-r--r-- | src/main/scala/spray/json/JsonParser.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/scala/spray/json/JsonParser.scala b/src/main/scala/spray/json/JsonParser.scala index 71c4c11..fb94b9c 100644 --- a/src/main/scala/spray/json/JsonParser.scala +++ b/src/main/scala/spray/json/JsonParser.scala @@ -18,9 +18,11 @@ package spray.json import scala.annotation.{switch, tailrec} import java.lang.{StringBuilder => JStringBuilder} -import java.nio.{CharBuffer, ByteBuffer} +import java.nio.{ByteBuffer, CharBuffer} import java.nio.charset.Charset +import scala.collection.immutable.TreeMap + /** * Fast, no-dependency parser for JSON as defined by http://tools.ietf.org/html/rfc4627. */ @@ -86,8 +88,7 @@ class JsonParser(input: ParserInput) { val nextMap = map.updated(key, jsValue) if (ws(',')) members(nextMap) else nextMap } - var map = Map.empty[String, JsValue] - map = members(map) + val map = members(TreeMap.empty[String, JsValue]) require('}') JsObject(map) } else { |