Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Mak <duncan@mono-cvs.ximian.com>2004-02-08 10:18:40 +0300
committerDuncan Mak <duncan@mono-cvs.ximian.com>2004-02-08 10:18:40 +0300
commitaf05f6a21a0b713fa86e2613651284d0b1077e0c (patch)
tree538d791e7069e0c5668bed81e0afae61b008e4f8 /mcs/class/corlib/System/Convert.cs
parentfcf97f0adb656f5cb3540de0961adc4a23f62cc3 (diff)
(ToType): Always let a Convert.ChangeType call
succeed if the source object is already of the destination type. svn path=/trunk/mcs/; revision=22873
Diffstat (limited to 'mcs/class/corlib/System/Convert.cs')
-rw-r--r--mcs/class/corlib/System/Convert.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/class/corlib/System/Convert.cs b/mcs/class/corlib/System/Convert.cs
index fa71727ff5a..5a78d7b01f7 100644
--- a/mcs/class/corlib/System/Convert.cs
+++ b/mcs/class/corlib/System/Convert.cs
@@ -7,7 +7,6 @@
//
// (C) Ximian, Inc. http://www.ximian.com
//
-
//
// System.Convert class. This was written word for word off the
// Library specification for System.Convert in the ECMA TC39 TG2
@@ -2479,6 +2478,9 @@ namespace System {
if (value == null)
throw new NullReferenceException ("Value is null.");
+
+ if (value.GetType () == conversionType)
+ return value;
if (value is IConvertible) {
IConvertible convertValue = (IConvertible) value;