Browse Source

Use a ternary in qr_solve.cpp

Scott Lahteine 9 years ago
parent
commit
54a39d8c1a
1 changed files with 2 additions and 8 deletions
  1. 2
    8
      Marlin/qr_solve.cpp

+ 2
- 8
Marlin/qr_solve.cpp View File

1488
       x[i + 2] = y[i + 2];
1488
       x[i + 2] = y[i + 2];
1489
       y[i + 2] = temp;
1489
       y[i + 2] = temp;
1490
     }
1490
     }
1491
-    if (0 <= incx)
1492
-      ix = 0;
1493
-    else
1494
-      ix = (- n + 1) * incx;
1495
-    if (0 <= incy)
1496
-      iy = 0;
1497
-    else
1498
-      iy = (- n + 1) * incy;
1499
   }
1491
   }
1500
   else {
1492
   else {
1493
+    ix = (incx >= 0) ? 0 : (-n + 1) * incx;
1494
+    iy = (incy >= 0) ? 0 : (-n + 1) * incy;
1501
     for (i = 0; i < n; i++) {
1495
     for (i = 0; i < n; i++) {
1502
       temp = x[ix];
1496
       temp = x[ix];
1503
       x[ix] = y[iy];
1497
       x[ix] = y[iy];

Loading…
Cancel
Save