Mercurial > hg > octave-nkf
diff liboctave/Array.cc @ 11210:b79924abf776
Array.cc: use comparisons to sortmode values instead of testing mode directly
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 09 Nov 2010 01:28:45 -0500 |
parents | f7f26094021b |
children | 80e01d79cf80 |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1711,7 +1711,7 @@ octave_sort<T> lsort; - if (mode) + if (mode != UNSORTED) lsort.set_compare (mode); else return m; @@ -1833,7 +1833,7 @@ sidx = Array<octave_idx_type> (dv); octave_idx_type *vi = sidx.fortran_vec (); - if (mode) + if (mode != UNSORTED) lsort.set_compare (mode); else return m; @@ -1970,7 +1970,7 @@ if (n <= 1) return mode ? mode : ASCENDING; - if (! mode) + if (mode == UNSORTED) { // Auto-detect mode. compare_fcn_type compare @@ -1982,7 +1982,7 @@ mode = ASCENDING; } - if (mode) + if (mode != UNSORTED) { lsort.set_compare (safe_comparator (mode, *this, false)); @@ -2023,7 +2023,7 @@ if (r <= 1 || c == 0) return mode ? mode : ASCENDING; - if (! mode) + if (mode == UNSORTED) { // Auto-detect mode. compare_fcn_type compare @@ -2054,11 +2054,11 @@ mode = DESCENDING; } } - if (! mode && i == cols ()) + if (mode == UNSORTED && i == cols ()) mode = ASCENDING; } - if (mode) + if (mode != UNSORTED) { lsort.set_compare (safe_comparator (mode, *this, false));