# HG changeset patch # User Jaroslav Hajek # Date 1248851388 -7200 # Node ID 2ebd0717c12dd91c2b28d7b9263929c2eb5252ea # Parent 40de4692c860a4b2ef2d6d41f71d6507fb0edef9 also cache class dispatch lookups in function handles diff -r 40de4692c860 -r 2ebd0717c12d src/ChangeLog --- a/src/ChangeLog Tue Jul 28 13:46:23 2009 +0200 +++ b/src/ChangeLog Wed Jul 29 09:09:48 2009 +0200 @@ -1,3 +1,8 @@ +2009-07-29 Jaroslav Hajek + + * ov-fcn-handle.cc (octave_fcn_handle::do_multi_index_op): + Cache lookups also for classes. + 2009-07-28 Jaroslav Hajek * DLD-FUNCTIONS/cellfun.cc (Fcellfun): Support auto-expanding scalar diff -r 40de4692c860 -r 2ebd0717c12d src/ov-fcn-handle.cc --- 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 ())