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/Util/TypeConverters EncodingConverter.cs
Date Sun, 19 Dec 2004 19:24:47 GMT
nicko       2004/12/19 11:24:47

  Modified:    src/Util/TypeConverters EncodingConverter.cs
  Log:
  Updates suggested by FxCop.
  Minor naming changes to internal types.
  Perf improvements to type check + type cast code.
  
  Revision  Changes    Path
  1.3       +3 -2      logging-log4net/src/Util/TypeConverters/EncodingConverter.cs
  
  Index: EncodingConverter.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Util/TypeConverters/EncodingConverter.cs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EncodingConverter.cs	16 Feb 2004 02:10:55 -0000	1.2
  +++ EncodingConverter.cs	19 Dec 2004 19:24:47 -0000	1.3
  @@ -51,9 +51,10 @@
   		/// <returns>the encoding</returns>
   		public object ConvertFrom(object source) 
   		{
  -			if (source is string) 
  +			string str = source as string;
  +			if (str != null) 
   			{
  -				return Encoding.GetEncoding((string)source);
  +				return Encoding.GetEncoding(str);
   			}
   			throw ConversionNotSupportedException.Create(typeof(Encoding), source);
   		}
  
  
  

Mime
View raw message