From a47da4b6fecaba81dafe777b25be24e04a428e37 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Fri, 3 Feb 2017 09:20:54 +0100 Subject: Use z = std::max(x - y, 0); instead of z = x - y; if (z < 0) z = 0; --- src/qt/coincontroldialog.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/qt') diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index f8aba70d92..d4fd8bd372 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -563,9 +563,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) } // after fee - nAfterFee = nAmount - nPayFee; - if (nAfterFee < 0) - nAfterFee = 0; + nAfterFee = std::max(nAmount - nPayFee, 0); } // actually update labels -- cgit v1.2.3