Author: jbevain
Date: 2006-07-19 15:13:05 -0400 (Wed, 19 Jul 2006)
New Revision: 62767

Modified:
   trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs
   trunk/cecil/lib/Mono.Cecil.Cil/CodeReader.cs
   trunk/cecil/lib/Mono.Cecil.Cil/ExceptionHandler.cs
   trunk/cecil/lib/Mono.Cecil.Cil/MethodBody.cs
Log:
remove unecessary casts

Modified: trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs 2006-07-19 19:10:28 UTC (rev 
62766)
+++ trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs 2006-07-19 19:13:05 UTC (rev 
62767)
@@ -29,11 +29,8 @@
 namespace Mono.Cecil.Cil {
 
        using System;
-       using System.Collections;
        using SR = System.Reflection;
 
-       using Mono.Cecil;
-
        public sealed class CilWorker : ICilWorker {
 
                MethodBody m_mbody;
@@ -42,7 +39,7 @@
                internal CilWorker (MethodBody body)
                {
                        m_mbody = body;
-                       m_instrs = m_mbody.Instructions as 
InstructionCollection;
+                       m_instrs = m_mbody.Instructions;
                }
 
                public MethodBody GetBody ()

Modified: trunk/cecil/lib/Mono.Cecil.Cil/CodeReader.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Cil/CodeReader.cs        2006-07-19 19:10:28 UTC 
(rev 62766)
+++ trunk/cecil/lib/Mono.Cecil.Cil/CodeReader.cs        2006-07-19 19:13:05 UTC 
(rev 62767)
@@ -33,7 +33,6 @@
        using System.IO;
 
        using Mono.Cecil;
-       using Mono.Cecil.Binary;
        using Mono.Cecil.Metadata;
        using Mono.Cecil.Signatures;
 
@@ -50,8 +49,8 @@
 
                public override void VisitMethodBody (MethodBody body)
                {
-                       MethodDefinition meth = body.Method as MethodDefinition;
-                       MethodBody methBody = body as MethodBody;
+                       MethodDefinition meth = body.Method;
+                       MethodBody methBody = body;
                        BinaryReader br = 
m_reflectReader.Module.ImageReader.MetadataReader.GetDataReader (meth.RVA);
 
                        // lets read the method
@@ -146,10 +145,10 @@
                                                instr.Operand = br.ReadByte ();
                                        break;
                                case OperandType.ShortInlineVar :
-                                       instr.Operand = body.Variables [(int) 
br.ReadByte ()];
+                                       instr.Operand = body.Variables 
[br.ReadByte ()];
                                        break;
                                case OperandType.ShortInlineParam :
-                                       instr.Operand = GetParameter (body, 
(int) br.ReadByte ());
+                                       instr.Operand = GetParameter (body, 
br.ReadByte ());
                                        break;
                                case OperandType.InlineSig :
                                        instr.Operand = GetCallSiteAt 
(br.ReadInt32 (), context);
@@ -158,10 +157,10 @@
                                        instr.Operand = br.ReadInt32 ();
                                        break;
                                case OperandType.InlineVar :
-                                       instr.Operand = body.Variables [(int) 
br.ReadInt16 ()];
+                                       instr.Operand = body.Variables 
[br.ReadInt16 ()];
                                        break;
                                case OperandType.InlineParam :
-                                       instr.Operand = GetParameter (body, 
(int) br.ReadInt16 ());
+                                       instr.Operand = GetParameter (body, 
br.ReadInt16 ());
                                        break;
                                case OperandType.InlineI8 :
                                        instr.Operand = br.ReadInt64 ();

Modified: trunk/cecil/lib/Mono.Cecil.Cil/ExceptionHandler.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Cil/ExceptionHandler.cs  2006-07-19 19:10:28 UTC 
(rev 62766)
+++ trunk/cecil/lib/Mono.Cecil.Cil/ExceptionHandler.cs  2006-07-19 19:13:05 UTC 
(rev 62767)
@@ -44,32 +44,32 @@
 
                public Instruction TryStart {
                        get { return m_tryStart; }
-                       set { m_tryStart = value as Instruction; }
+                       set { m_tryStart = value; }
                }
 
                public Instruction TryEnd {
                        get { return m_tryEnd; }
-                       set { m_tryEnd = value as Instruction; }
+                       set { m_tryEnd = value; }
                }
 
                public Instruction FilterStart {
                        get { return m_filterStart; }
-                       set { m_filterStart = value as Instruction; }
+                       set { m_filterStart = value; }
                }
 
                public Instruction FilterEnd {
                        get { return m_filterEnd; }
-                       set { m_filterEnd = value as Instruction; }
+                       set { m_filterEnd = value; }
                }
 
                public Instruction HandlerStart {
                        get { return m_handlerStart; }
-                       set { m_handlerStart = value as Instruction; }
+                       set { m_handlerStart = value; }
                }
 
                public Instruction HandlerEnd {
                        get { return m_handlerEnd; }
-                       set { m_handlerEnd = value as Instruction; }
+                       set { m_handlerEnd = value; }
                }
 
                public TypeReference CatchType {

Modified: trunk/cecil/lib/Mono.Cecil.Cil/MethodBody.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Cil/MethodBody.cs        2006-07-19 19:10:28 UTC 
(rev 62766)
+++ trunk/cecil/lib/Mono.Cecil.Cil/MethodBody.cs        2006-07-19 19:13:05 UTC 
(rev 62767)
@@ -28,12 +28,7 @@
 
 namespace Mono.Cecil.Cil {
 
-       using System;
-       using System.Collections;
-
        using Mono.Cecil;
-       using Mono.Cecil.Binary;
-       using Mono.Cecil.Signatures;
 
        public sealed class MethodBody : IMethodBody {
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to