@@ -70,8 +70,6 @@ private void BuildMultiTypeSwitchMethodBody(MethodDefinition method, TypeDefinit
7070 {
7171 var body = method . Body ;
7272 body . InitLocals = true ;
73- body . Variables . Add ( new VariableDefinition ( TypeSystem . BooleanDefinition ) ) ;
74- body . Variables . Add ( new VariableDefinition ( baseType ) ) ;
7573 body . Instructions . Clear ( ) ;
7674
7775 var processor = body . GetILProcessor ( ) ;
@@ -82,12 +80,8 @@ private void BuildMultiTypeSwitchMethodBody(MethodDefinition method, TypeDefinit
8280 processor . Emit ( OpCodes . Ldarg_0 ) ;
8381 processor . Emit ( OpCodes . Ldnull ) ;
8482 processor . Emit ( OpCodes . Ceq ) ;
85- processor . Emit ( OpCodes . Stloc_0 ) ;
86- processor . Emit ( OpCodes . Ldloc_0 ) ;
8783 processor . Emit ( OpCodes . Brfalse_S , startType ) ;
8884 processor . Emit ( OpCodes . Ldnull ) ;
89- processor . Emit ( OpCodes . Stloc_1 ) ;
90- processor . Emit ( OpCodes . Ldloc_1 ) ;
9185 processor . Emit ( OpCodes . Ret ) ;
9286
9387 var copiedTypes = new List < TypeDefinition > ( ) ;
@@ -120,8 +114,6 @@ private void BuildMultiTypeSwitchMethodBody(MethodDefinition method, TypeDefinit
120114 processor . Emit ( OpCodes . Ldloc , variable ) ;
121115
122116 processor . Emit ( OpCodes . Newobj , constructor ) ;
123- processor . Emit ( OpCodes . Stloc_1 ) ;
124- processor . Emit ( OpCodes . Ldloc_1 ) ;
125117 processor . Emit ( OpCodes . Ret ) ;
126118
127119 processor . Append ( endType ) ;
0 commit comments