Browse Source

refactoring

svn path=/trunk/mcs/; revision=101236
Jb Evain 17 years ago
parent
commit
607c910e2f
1 changed files with 5 additions and 4 deletions
  1. 5 4
      mcs/class/System.Core/System.Linq.Expressions/EmitContext.cs

+ 5 - 4
mcs/class/System.Core/System.Linq.Expressions/EmitContext.cs

@@ -215,18 +215,19 @@ namespace System.Linq.Expressions {
 				return;
 
 			var value = constant.Value;
+			var type = value.GetType ();
 
-			if (Type.GetTypeCode (value.GetType ()) != TypeCode.Object)
+			if (Type.GetTypeCode (type) != TypeCode.Object)
 				return;
 
 			indexes.Add (value, globals.Count);
-			globals.Add (CreateStrongBox (value));
+			globals.Add (CreateStrongBox (value, type));
 		}
 
-		static object CreateStrongBox (object value)
+		static object CreateStrongBox (object value, Type type)
 		{
 			return Activator.CreateInstance (
-				value.GetType ().MakeStrongBoxType (), value);
+				type.MakeStrongBoxType (), value);
 		}
 	}