[Kde-bindings] playground/bindings/kimono

Arno Rehn kde at arnorehn.de
Wed Oct 18 12:37:52 UTC 2006


SVN commit 596761 by arnorehn:

* Added a methodCache, so if a methodId has already been looked up it can
  be retrieved from the methodCache.

CCMAIL: kde-bindings at kde.org



 M  +5 -0      ChangeLog  
 M  +11 -1     SmokeInvocation.cs  


--- trunk/playground/bindings/kimono/ChangeLog #596760:596761
@@ -1,3 +1,8 @@
+2006-10-18  Arno Rehn  <arno at arnorehn.de>
+
+	* Added a methodCache, so if a methodId has already been looked up it can
+	  be retrieved from the methodCache.
+
 2006-10-15  Richard Dale  <rdale at foton.es>
 
 	* When there was more than one possible candidate for a method in the
--- trunk/playground/bindings/kimono/SmokeInvocation.cs #596760:596761
@@ -574,6 +574,7 @@
 		private Type	_classToProxy;
 		private Object	_instance;
 		private string	_className;
+		private Hashtable methodCache = new Hashtable();
 		
 		public SmokeInvocation(Type classToProxy, Object instance) : base(classToProxy) 
 		{
@@ -686,7 +687,16 @@
 				}
 			}
 
-			int methodId = FindMethod(mungedName, (MethodInfo) callMessage.MethodBase);
+			int methodId;
+			if (!methodCache.ContainsKey(callMessage.MethodBase)) {
+// 				Console.WriteLine("Creating entry in methodCache");
+				methodId = FindMethod(mungedName, (MethodInfo) callMessage.MethodBase);
+				methodCache.Add(callMessage.MethodBase, (object) methodId);
+			} else {
+// 				Console.WriteLine("Found entry in methodCache");
+				methodId = (int) methodCache[callMessage.MethodBase];
+			}
+			
 			if (methodId == -1) {
 #if DEBUG
 				Console.WriteLine("LEAVE Invoke() ** Missing method ** {0}", mungedName);



More information about the Kde-bindings mailing list