# HG changeset patch # User jwe # Date 1074799854 0 # Node ID 5101dffb417856107215dfc49cbab2bfbad74247 # Parent 48191fcee04db199a7d761e0b91533e5dc5225df [project @ 2004-01-22 19:30:54 by jwe] diff -r 48191fcee04d -r 5101dffb4178 liboctave/Array.cc --- a/liboctave/Array.cc Thu Jan 22 19:12:02 2004 +0000 +++ b/liboctave/Array.cc Thu Jan 22 19:30:54 2004 +0000 @@ -2733,24 +2733,13 @@ Array result_idx (lhs_dims.length (), 0); - Array elt_idx; - RT scalar = rhs.elem (0); for (int i = 0; i < n; i++) { - elt_idx = get_elt_idx (idx, result_idx); - - dim_vector lhs_inc; - lhs_inc.resize (lhs_dims.length ()); - - for (int j = 0; j < lhs_dims.length (); j++) - lhs_inc(j) = lhs_dims(j) + 1; - - if (index_in_bounds(elt_idx, lhs_inc)) - lhs.checkelem (elt_idx) = scalar; - else - lhs.checkelem (elt_idx) = rfv; + Array elt_idx = get_elt_idx (idx, result_idx); + + lhs.checkelem (elt_idx) = scalar; increment_index (result_idx, frozen_len); } diff -r 48191fcee04d -r 5101dffb4178 liboctave/ChangeLog --- a/liboctave/ChangeLog Thu Jan 22 19:12:02 2004 +0000 +++ b/liboctave/ChangeLog Thu Jan 22 19:30:54 2004 +0000 @@ -1,3 +1,8 @@ +2004-01-22 Petter Risholm + + * Array.cc (Array::assignN): Eliminate unnecessray code for + filling when RHS is scalar and dimension lengths agree. + 2004-01-22 John W. Eaton * Makefile.in (distclean): Remove $(MX_OP_INC), $(VX_OP_INC),