diff src/ov-complex.cc @ 8437:f00578b495e9

remove valid_as_scalar_index
author Jaroslav Hajek <highegg@gmail.com>
date Sat, 27 Dec 2008 17:01:52 +0100
parents c777f3ce02d8
children eb63fbe60fab
line wrap: on
line diff
--- a/src/ov-complex.cc	Fri Dec 26 22:54:38 2008 +0100
+++ b/src/ov-complex.cc	Sat Dec 27 17:01:52 2008 +0100
@@ -86,28 +86,19 @@
 octave_value
 octave_complex::do_index_op (const octave_value_list& idx, bool resize_ok)
 {
-  octave_value retval;
+  // FIXME -- this doesn't solve the problem of
+  //
+  //   a = i; a([1,1], [1,1], [1,1])
+  //
+  // and similar constructions.  Hmm...
 
-  if (idx.valid_scalar_indices ())
-    retval = scalar;
-  else
-    {
-      // FIXME -- this doesn't solve the problem of
-      //
-      //   a = i; a([1,1], [1,1], [1,1])
-      //
-      // and similar constructions.  Hmm...
+  // FIXME -- using this constructor avoids narrowing the
+  // 1x1 matrix back to a scalar value.  Need a better solution
+  // to this problem.
 
-      // FIXME -- using this constructor avoids narrowing the
-      // 1x1 matrix back to a scalar value.  Need a better solution
-      // to this problem.
+  octave_value tmp (new octave_complex_matrix (complex_matrix_value ()));
 
-      octave_value tmp (new octave_complex_matrix (complex_matrix_value ()));
-
-      retval = tmp.do_index_op (idx, resize_ok);
-    }
-
-  return retval;
+  return tmp.do_index_op (idx, resize_ok);
 }
 
 double