logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject cvs commit: logging-log4net/src/ObjectRenderer DefaultRenderer.cs
Date Sun, 19 Dec 2004 19:23:42 GMT
nicko       2004/12/19 11:23:42

  Modified:    src/ObjectRenderer DefaultRenderer.cs
  Log:
  Updates suggested by FxCop.
  Minor naming changes to internal types.
  Perf improvements to type check + type cast code.
  
  Revision  Changes    Path
  1.8       +17 -10    logging-log4net/src/ObjectRenderer/DefaultRenderer.cs
  
  Index: DefaultRenderer.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/ObjectRenderer/DefaultRenderer.cs,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultRenderer.cs	6 Dec 2004 02:26:04 -0000	1.7
  +++ DefaultRenderer.cs	19 Dec 2004 19:23:42 -0000	1.8
  @@ -145,24 +145,31 @@
   			if (obj == null)
   			{
   				writer.Write("(null)");
  +				return;
   			}
  -			else if (obj is Array)
  +			
  +			Array objArray = obj as Array;
  +			if (objArray != null)
   			{
  -				RenderArray(rendererMap, (Array)obj, writer);
  +				RenderArray(rendererMap, objArray, writer);
  +				return;
   			}
  -			else if (obj is ICollection)
  +			
  +			ICollection objCollection = obj as ICollection;
  +			if (objCollection != null)
   			{
  -				RenderCollection(rendererMap, (ICollection)obj, writer);
  +				RenderCollection(rendererMap, objCollection, writer);
  +				return;
   			}
  -			else if (obj is DictionaryEntry)
  +			
  +			if (obj is DictionaryEntry)
   			{
   				RenderDictionaryEntry(rendererMap, (DictionaryEntry)obj, writer);
  +				return;
   			}
  -			else
  -			{
  -				string str = obj.ToString();
  -				writer.Write( (str==null) ? "(null)" : str );
  -			}
  +
  +			string str = obj.ToString();
  +			writer.Write( (str==null) ? "(null)" : str );
   		}
   
   		#endregion
  
  
  

Mime
View raw message