From b88d6486a6bc22605c4b4537997fb6290ea33e08 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Thu, 27 Sep 2012 20:55:10 -0700 Subject: [PATCH] Rather than a polymorphic downcast, just fill in the object in place. --- src/SerializedObject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SerializedObject.cpp b/src/SerializedObject.cpp index e2f3cbeab3..4834a1f3f5 100644 --- a/src/SerializedObject.cpp +++ b/src/SerializedObject.cpp @@ -718,7 +718,8 @@ STArray* STArray::construct(SerializerIterator& sit, SField::ref field) if (fn.isInvalid()) throw std::runtime_error("Unknown field"); - value.push_back(*STObject::makeDeserializedObject(fn.fieldType, fn, sit, 1)); + value.push_back(STObject(fn)); + value.rbegin()->set(sit, 1); } return new STArray(field, value);