Mercurial > octave
comparison liboctave/array/fRowVector.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 |
comparison
equal
deleted
inserted
replaced
17662:0b7f5c56f853 | 17663:7975d75f933c |
---|---|
117 { | 117 { |
118 (*current_liboctave_error_handler) ("range error for fill"); | 118 (*current_liboctave_error_handler) ("range error for fill"); |
119 return *this; | 119 return *this; |
120 } | 120 } |
121 | 121 |
122 if (c1 > c2) { octave_idx_type tmp = c1; c1 = c2; c2 = tmp; } | 122 if (c1 > c2) { std::swap (c1, c2); } |
123 | 123 |
124 if (c2 >= c1) | 124 if (c2 >= c1) |
125 { | 125 { |
126 make_unique (); | 126 make_unique (); |
127 | 127 |
162 } | 162 } |
163 | 163 |
164 FloatRowVector | 164 FloatRowVector |
165 FloatRowVector::extract (octave_idx_type c1, octave_idx_type c2) const | 165 FloatRowVector::extract (octave_idx_type c1, octave_idx_type c2) const |
166 { | 166 { |
167 if (c1 > c2) { octave_idx_type tmp = c1; c1 = c2; c2 = tmp; } | 167 if (c1 > c2) { std::swap (c1, c2); } |
168 | 168 |
169 octave_idx_type new_c = c2 - c1 + 1; | 169 octave_idx_type new_c = c2 - c1 + 1; |
170 | 170 |
171 FloatRowVector result (new_c); | 171 FloatRowVector result (new_c); |
172 | 172 |