Mercurial > hg > octave-lyh
changeset 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 | 40de4692c860 |
children | 49f890499ebc |
files | src/ChangeLog src/ov-fcn-handle.cc |
diffstat | 2 files changed, 17 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-07-29 Jaroslav Hajek <highegg@gmail.com> + + * ov-fcn-handle.cc (octave_fcn_handle::do_multi_index_op): + Cache lookups also for classes. + 2009-07-28 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTIONS/cellfun.cc (Fcellfun): Support auto-expanding scalar
--- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -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 ())