diff --git a/src/JSONValue.cpp b/src/JSONValue.cpp index 376059e..566f0c2 100644 --- a/src/JSONValue.cpp +++ b/src/JSONValue.cpp @@ -310,7 +310,7 @@ JSONValue *JSONValue::Parse(const wchar_t **data) * * @access public */ -JSONValue::JSONValue(/*NULL*/) +JSONValue::JSONValue(/*NULL*/) : type(JSONType_Null) { type = JSONType_Null; } @@ -322,9 +322,8 @@ JSONValue::JSONValue(/*NULL*/) * * @param wchar_t* m_char_value The string to use as the value */ -JSONValue::JSONValue(const wchar_t *m_char_value) +JSONValue::JSONValue(const wchar_t *m_char_value) : type(JSONType_String) { - type = JSONType_String; string_value = new std::wstring(std::wstring(m_char_value)); } @@ -335,9 +334,8 @@ JSONValue::JSONValue(const wchar_t *m_char_value) * * @param std::wstring m_string_value The string to use as the value */ -JSONValue::JSONValue(const std::wstring &m_string_value) +JSONValue::JSONValue(const std::wstring &m_string_value) : type(JSONType_String) { - type = JSONType_String; string_value = new std::wstring(m_string_value); } @@ -348,9 +346,8 @@ JSONValue::JSONValue(const std::wstring &m_string_value) * * @param bool m_bool_value The bool to use as the value */ -JSONValue::JSONValue(bool m_bool_value) +JSONValue::JSONValue(bool m_bool_value) : type(JSONType_Bool) { - type = JSONType_Bool; bool_value = m_bool_value; } @@ -361,9 +358,8 @@ JSONValue::JSONValue(bool m_bool_value) * * @param double m_number_value The number to use as the value */ -JSONValue::JSONValue(double m_number_value) +JSONValue::JSONValue(double m_number_value) : type(JSONType_Number) { - type = JSONType_Number; number_value = m_number_value; } @@ -374,9 +370,8 @@ JSONValue::JSONValue(double m_number_value) * * @param JSONArray m_array_value The JSONArray to use as the value */ -JSONValue::JSONValue(const JSONArray &m_array_value) +JSONValue::JSONValue(const JSONArray &m_array_value) : type(JSONType_Array) { - type = JSONType_Array; array_value = new JSONArray(m_array_value); } @@ -387,9 +382,8 @@ JSONValue::JSONValue(const JSONArray &m_array_value) * * @param JSONObject m_object_value The JSONObject to use as the value */ -JSONValue::JSONValue(const JSONObject &m_object_value) +JSONValue::JSONValue(const JSONObject &m_object_value) : type(JSONType_Object) { - type = JSONType_Object; object_value = new JSONObject(m_object_value); } @@ -400,10 +394,8 @@ JSONValue::JSONValue(const JSONObject &m_object_value) * * @param JSONValue m_source The source JSONValue that is being copied */ -JSONValue::JSONValue(const JSONValue &m_source) +JSONValue::JSONValue(const JSONValue &m_source) : type(m_source.type) { - type = m_source.type; - switch (type) { case JSONType_String: