Minor simplifications

This commit is contained in:
Benoît Blanchon
2014-06-26 13:18:28 +02:00
parent 1c4d4bfd2d
commit 33508e3fe0
2 changed files with 1 additions and 18 deletions

View File

@ -30,20 +30,6 @@ namespace JsonGeneratorTests
AssertJsonIs("[\"hello\"]"); AssertJsonIs("[\"hello\"]");
} }
TEST_METHOD(AddOneStringContainingDoubleQuote)
{
arr.add("\"");
AssertJsonIs("[\"\\\"\"]");
}
TEST_METHOD(AddOneStringContainingBackslash)
{
arr.add("\\");
AssertJsonIs("[\"\\\\\"]");
}
TEST_METHOD(AddTwoStrings) TEST_METHOD(AddTwoStrings)
{ {
arr.add("hello"); arr.add("hello");

View File

@ -5,10 +5,7 @@ void JsonObjectBase::writeObjectTo(ObjectContainer& obj, StringBuilder& sb)
switch (obj.type) switch (obj.type)
{ {
case JSON_STRING: case JSON_STRING:
if (obj.value.string) sb.appendEscaped(obj.value.string);
sb.appendEscaped(obj.value.string);
else
sb.append("null");
break; break;
case JSON_NUMBER: case JSON_NUMBER: