Skip to content

Commit a84a2dc

Browse files
committed
Accidentally lowered object performance.
1 parent ab0d1c5 commit a84a2dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ impl<'a> Parser<'a> {
710710
// Given how compilcated reading numbers and strings is, reading objects
711711
// is actually pretty simple.
712712
fn read_object(&mut self) -> Result<Object> {
713-
let mut object = Object::with_capacity(2);
713+
let mut object = Object::with_capacity(3);
714714

715715
let key = expect!{ self,
716716
b'}' => return Ok(object),
@@ -742,7 +742,7 @@ impl<'a> Parser<'a> {
742742
fn read_array(&mut self) -> Result<Vec<JsonValue>> {
743743
let first = expect_value!{ self, b']' => return Ok(Vec::new()) };
744744

745-
let mut array = Vec::with_capacity(3);
745+
let mut array = Vec::with_capacity(2);
746746
array.push(first);
747747

748748
loop {

0 commit comments

Comments
 (0)