comparison liboctave/array/CColVector.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
160 { 160 {
161 (*current_liboctave_error_handler) ("range error for fill"); 161 (*current_liboctave_error_handler) ("range error for fill");
162 return *this; 162 return *this;
163 } 163 }
164 164
165 if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } 165 if (r1 > r2) { std::swap (r1, r2); }
166 166
167 if (r2 >= r1) 167 if (r2 >= r1)
168 { 168 {
169 make_unique (); 169 make_unique ();
170 170
184 { 184 {
185 (*current_liboctave_error_handler) ("range error for fill"); 185 (*current_liboctave_error_handler) ("range error for fill");
186 return *this; 186 return *this;
187 } 187 }
188 188
189 if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } 189 if (r1 > r2) { std::swap (r1, r2); }
190 190
191 if (r2 >= r1) 191 if (r2 >= r1)
192 { 192 {
193 make_unique (); 193 make_unique ();
194 194
248 // resize is the destructive equivalent for this one 248 // resize is the destructive equivalent for this one
249 249
250 ComplexColumnVector 250 ComplexColumnVector
251 ComplexColumnVector::extract (octave_idx_type r1, octave_idx_type r2) const 251 ComplexColumnVector::extract (octave_idx_type r1, octave_idx_type r2) const
252 { 252 {
253 if (r1 > r2) { octave_idx_type tmp = r1; r1 = r2; r2 = tmp; } 253 if (r1 > r2) { std::swap (r1, r2); }
254 254
255 octave_idx_type new_r = r2 - r1 + 1; 255 octave_idx_type new_r = r2 - r1 + 1;
256 256
257 ComplexColumnVector result (new_r); 257 ComplexColumnVector result (new_r);
258 258