diff src/ov-fcn-handle.cc @ 9466:2ebd0717c12d

also cache class dispatch lookups in function handles
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 29 Jul 2009 09:09:48 +0200
parents d34baf412786
children c5330ef7aecd
line wrap: on
line diff
--- a/src/ov-fcn-handle.cc	Tue Jul 28 13:46:23 2009 +0200
+++ b/src/ov-fcn-handle.cc	Wed Jul 29 09:09:48 2009 +0200
@@ -149,9 +149,18 @@
         }
       else
         {
-          octave_value method = symbol_table::find_method (nm, ddt);
-          if (method.is_defined ())
-            ovfcn = method;
+          str_ov_map::iterator pos = disp->find (ddt);
+          if (pos != disp->end ())
+            {
+              out_of_date_check (pos->second, ddt);
+              ovfcn = pos->second;
+            }
+          else
+            {
+              octave_value method = symbol_table::find_method (nm, ddt);
+              if (method.is_defined ())
+                (*disp)[ddt] = ovfcn = method;
+            }
         }
 
       if (ovfcn.is_defined ())