nicko 2004/12/19 11:25:04
Modified: src/Util/TypeConverters TypeConverter.cs
Log:
Updates suggested by FxCop.
Minor naming changes to internal types.
Perf improvements to type check + type cast code.
Revision Changes Path
1.2 +3 -2 logging-log4net/src/Util/TypeConverters/TypeConverter.cs
Index: TypeConverter.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Util/TypeConverters/TypeConverter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TypeConverter.cs 30 Jul 2004 14:15:30 -0000 1.1
+++ TypeConverter.cs 19 Dec 2004 19:25:04 -0000 1.2
@@ -49,9 +49,10 @@
/// <returns>the Type</returns>
public object ConvertFrom(object source)
{
- if (source is string)
+ string str = source as string;
+ if (str != null)
{
- return
SystemInfo.GetTypeFromString((string)source, true, true);
+ return SystemInfo.GetTypeFromString(str, true,
true);
}
throw
ConversionNotSupportedException.Create(typeof(Type), source);
}