comparison libinterp/octave-value/ov-cell.cc @ 21118:3ac9f47fb04b

Invert pattern if/code/else/err_XXX to if !/err_XXX/code. * daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, load-save.cc, lsode.cc, quad.cc, xnorm.cc, xpow.cc, ov-base-diag.cc, ov-base-mat.cc, ov-base-scalar.cc, ov-base.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc, ov-ch-mat.cc, ov-class.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-intx.h, ov-perm.cc, ov-range.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-struct.cc, ov.cc, pt-idx.cc, Array-util.cc, Array.cc, Sparse.cc, lo-specfun.cc, mx-inlines.cc, oct-binmap.h: Invert pattern if/code/else/err_XXX to if !/err_XXX/code.
author Rik <rik@octave.org>
date Wed, 20 Jan 2016 16:08:30 -0800
parents dfcb9d74b253
children f5b17eb2508b
comparison
equal deleted inserted replaced
21117:c1df36373272 21118:3ac9f47fb04b
285 285
286 next_idx.erase (next_idx.begin ()); 286 next_idx.erase (next_idx.begin ());
287 287
288 std::string next_type = type.substr (1); 288 std::string next_type = type.substr (1);
289 289
290 if (tmpc.numel () == 1) 290 if (tmpc.numel () != 1)
291 err_indexed_cs_list ();
292
293 octave_value tmp = tmpc(0);
294 tmpc = Cell ();
295
296 if (! tmp.is_defined () || tmp.is_zero_by_zero ())
291 { 297 {
292 octave_value tmp = tmpc(0); 298 tmp = octave_value::empty_conv (type.substr (1), rhs);
293 tmpc = Cell (); 299 tmp.make_unique (); // probably a no-op.
294
295 if (! tmp.is_defined () || tmp.is_zero_by_zero ())
296 {
297 tmp = octave_value::empty_conv (type.substr (1), rhs);
298 tmp.make_unique (); // probably a no-op.
299 }
300 else
301 // optimization: ignore copy still stored inside array.
302 tmp.make_unique (1);
303
304 t_rhs = tmp.subsasgn (next_type, next_idx, rhs);
305 } 300 }
306 else 301 else
307 err_indexed_cs_list (); 302 // optimization: ignore copy still stored inside array.
303 tmp.make_unique (1);
304
305 t_rhs = tmp.subsasgn (next_type, next_idx, rhs);
308 } 306 }
309 break; 307 break;
310 308
311 case '.': 309 case '.':
312 { 310 {