From 54a39d8c1a132628e5cb4021fa748c70658fca9d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 13 Oct 2015 03:59:04 -0700 Subject: [PATCH] Use a ternary in qr_solve.cpp --- Marlin/qr_solve.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Marlin/qr_solve.cpp b/Marlin/qr_solve.cpp index da17377f9..1e085c95b 100644 --- a/Marlin/qr_solve.cpp +++ b/Marlin/qr_solve.cpp @@ -1488,16 +1488,10 @@ void dswap(int n, double x[], int incx, double y[], int incy) x[i + 2] = y[i + 2]; y[i + 2] = temp; } - if (0 <= incx) - ix = 0; - else - ix = (- n + 1) * incx; - if (0 <= incy) - iy = 0; - else - iy = (- n + 1) * incy; } else { + ix = (incx >= 0) ? 0 : (-n + 1) * incx; + iy = (incy >= 0) ? 0 : (-n + 1) * incy; for (i = 0; i < n; i++) { temp = x[ix]; x[ix] = y[iy];