Mercurial > hg > octave-nkf
diff liboctave/array/chMatrix.cc @ 17663:7975d75f933c
Use std::swap in liboctave instead of temporary variable.
* liboctave/array/CColVector.cc, liboctave/array/CDiagMatrix.cc,
liboctave/array/CMatrix.cc, liboctave/array/CRowVector.cc,
liboctave/array/chMatrix.cc, liboctave/array/dColVector.cc,
liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc,
liboctave/array/dRowVector.cc, liboctave/array/fCColVector.cc,
liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fCRowVector.cc, liboctave/array/fColVector.cc,
liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc,
liboctave/array/fRowVector.cc, liboctave/numeric/sparse-dmsolve.cc:
Use std::swap in liboctave instead of temporary variable.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 15 Oct 2013 14:59:09 -0700 |
parents | 648dabbb4c6b |
children | d63878346099 |
line wrap: on
line diff
--- a/liboctave/array/chMatrix.cc +++ b/liboctave/array/chMatrix.cc @@ -169,8 +169,8 @@ charMatrix charMatrix::extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const { - if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } - if (c1 > c2) { octave_idx_type tmp = c1; c1 = c2; c2 = tmp; } + if (r1 > r2) { std::swap (r1, r2); } + if (c1 > c2) { std::swap (c1, c2); } octave_idx_type new_r = r2 - r1 + 1; octave_idx_type new_c = c2 - c1 + 1;