Mercurial > hg > octave-lojdl
changeset 8031:d9987dbdf91b
octave_struct::subsref: don't resize for simple x(idx) case
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 12 Aug 2008 13:20:27 -0400 |
parents | c42ba026faf1 |
children | 2fd4a5ef6b59 |
files | src/ChangeLog src/ov-struct.cc |
diffstat | 2 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-08-12 John W. Eaton <jwe@octave.org> + + * ov-struct.cc (octave_struct::subsref): Don't allow resizing for + simple x(idx) case. + 2008-08-07 John W. Eaton <jwe@octave.org> * ov.cc (octave_value::idx_type_value): Don't include default
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -129,7 +129,7 @@ } } else - retval(0) = map.index (idx.front (), true); + retval(0) = map.index (idx.front (), false); } break; @@ -162,6 +162,14 @@ return retval; } +/* +%!test +%! x(1).a.a = 1; x(2).a.a = 2; +%! assert (size (x), [1, 2]); +%! assert (x(1).a.a, 1); +%! assert (x(2).a.a, 2); +*/ + octave_value octave_struct::numeric_conv (const Cell& val, const std::string& type)