@@ -79,11 +79,6 @@ public IEnumerable<KeyValuePair<string, string>> Serialize(string name, object o
7979 /// <returns></returns>
8080 private IEnumerable < KeyValuePair < string , string > > ForamtAsEnumerable ( string name , IEnumerable enumerable , FormatOptions options )
8181 {
82- if ( enumerable == null )
83- {
84- return Enumerable . Empty < KeyValuePair < string , string > > ( ) ;
85- }
86-
8782 return from item in enumerable . Cast < object > ( )
8883 select this . FormatAsSimple ( name , item , options ) ;
8984 }
@@ -96,11 +91,6 @@ private IEnumerable<KeyValuePair<string, string>> ForamtAsEnumerable(string name
9691 /// <returns></returns>
9792 private IEnumerable < KeyValuePair < string , string > > FormatAsComplex ( object instance , FormatOptions options )
9893 {
99- if ( instance == null )
100- {
101- return Enumerable . Empty < KeyValuePair < string , string > > ( ) ;
102- }
103-
10494 return
10595 from p in PropertyDescriptor . GetProperties ( instance . GetType ( ) )
10696 where p . IsSupportGet && p . IgnoreSerialized == false
@@ -117,10 +107,6 @@ from p in PropertyDescriptor.GetProperties(instance.GetType())
117107 /// <returns></returns>
118108 private IEnumerable < KeyValuePair < string , string > > FormatAsDictionary < TValue > ( IDictionary < string , TValue > dic , FormatOptions options )
119109 {
120- if ( dic == null )
121- {
122- return Enumerable . Empty < KeyValuePair < string , string > > ( ) ;
123- }
124110 return from kv in dic select this . FormatAsSimple ( kv . Key , kv . Value , options ) ;
125111 }
126112
0 commit comments