File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers/LightJson/Serialization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ namespace LightJson.Serialization
55{
66 using System ;
77 using System . Collections . Generic ;
8+ using System . Diagnostics ;
89 using System . Globalization ;
910 using System . IO ;
1011 using ErrorType = JsonSerializationException . ErrorType ;
@@ -146,20 +147,10 @@ private void WriteEncodedJsonValue(JsonValue value)
146147 this . writer . Write ( ( ( double ) value ) . ToString ( CultureInfo . InvariantCulture ) ) ;
147148 break ;
148149
149- case JsonValueType . String :
150+ default :
151+ Debug . Assert ( value . Type == JsonValueType . String , "value.Type == JsonValueType.String" ) ;
150152 this . WriteEncodedString ( ( string ) value ) ;
151153 break ;
152-
153- case JsonValueType . Object :
154- this . writer . Write ( string . Format ( "JsonObject[{0}]" , value . AsJsonObject . Count ) ) ;
155- break ;
156-
157- case JsonValueType . Array :
158- this . writer . Write ( string . Format ( "JsonArray[{0}]" , value . AsJsonArray . Count ) ) ;
159- break ;
160-
161- default :
162- throw new InvalidOperationException ( "Invalid value type." ) ;
163154 }
164155 }
165156
You can’t perform that action at this time.
0 commit comments