Small bug fix
authorMiguel de Icaza <miguel@gnome.org>
Wed, 6 Mar 2002 20:37:25 +0000 (20:37 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 6 Mar 2002 20:37:25 +0000 (20:37 -0000)
svn path=/trunk/mcs/; revision=2952

mcs/mcs/ChangeLog
mcs/mcs/ecore.cs
mcs/mcs/typemanager.cs

index 4d12b33586c8fb41b3868d068df534dbb90f0c1b..e21f8aa2eca3dffbad29c07da61b9dabde85a2e6 100755 (executable)
@@ -1,5 +1,7 @@
 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
 
+       * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
+
        * cs-parser.jay: Add opt_semicolon to the interface declaration.
 
        * expression.cs: Pass location information to
index c1194bcf1b290c03bb0c6f904ffdceedddd5882e..4ab573a83028efe3e668a57339b8dbe0bd201a10 100755 (executable)
@@ -1718,9 +1718,6 @@ namespace Mono.CSharp {
                        // From any interface type S to any interface T provided S is not derived from T
                        //
                        if (source_type.IsInterface && target_type.IsInterface){
-
-                               Type [] ifaces = source_type.GetInterfaces ();
-
                                if (TypeManager.ImplementsInterface (source_type, target_type))
                                        return null;
                                else
index 6527047fdb87834e5a60acb60304580dbea10f7c..806e52ec6cc38a41883ea9ba95b30e9bf994a2ba 100755 (executable)
@@ -177,7 +177,6 @@ public class TypeManager {
                method_arguments = new PtrHashtable ();
                method_internal_params = new PtrHashtable ();
                builder_to_container = new PtrHashtable ();
-               type_interface_cache = new PtrHashtable ();
                NoTypes = new Type [0];
        }
 
@@ -845,16 +844,21 @@ public class TypeManager {
                        return pi.GetGetMethod ();
        }
                                
-       // <remarks>
-       //  The following is used to check if a given type implements an interface.
-       //  The cache helps us reduce the expense of hitting Type.GetInterfaces everytime.
-       // </remarks>
-
-       static Hashtable type_interface_cache;
+       /// <remarks>
+       ///  The following is used to check if a given type implements an interface.
+       ///  The cache helps us reduce the expense of hitting Type.GetInterfaces everytime.
+       /// </remarks>
        public static bool ImplementsInterface (Type t, Type iface)
        {
                Type [] interfaces;
 
+               //
+               // FIXME OPTIMIZATION:
+               // as soon as we hit a non-TypeBuiler in the interface
+               // chain, we could return, as the `Type.GetInterfaces'
+               // will return all the interfaces implement by the type
+               // or its parents.
+               //
                do {
                        interfaces = t.GetInterfaces ();