From 0898a8d36a954e30724bb4ea55eda097d9fbcd6c Mon Sep 17 00:00:00 2001 From: MathisGD Date: Wed, 9 Aug 2023 22:59:09 +0200 Subject: [PATCH] style: remove brackets if else --- src/Blue.sol | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/Blue.sol b/src/Blue.sol index 4ef376bf6..6b943d2dc 100644 --- a/src/Blue.sol +++ b/src/Blue.sol @@ -153,11 +153,8 @@ contract Blue is IBlue { _accrueInterests(market, id); - if (shares > 0) { - amount = shares.toAssetsUp(totalSupply[id], totalSupplyShares[id]); - } else { - shares = amount.toSharesDown(totalSupply[id], totalSupplyShares[id]); - } + if (shares > 0) amount = shares.toAssetsUp(totalSupply[id], totalSupplyShares[id]); + else shares = amount.toSharesDown(totalSupply[id], totalSupplyShares[id]); supplyShares[id][onBehalf] += shares; totalSupplyShares[id] += shares; @@ -182,11 +179,8 @@ contract Blue is IBlue { _accrueInterests(market, id); - if (shares > 0) { - amount = shares.toAssetsDown(totalSupply[id], totalSupplyShares[id]); - } else { - shares = amount.toSharesUp(totalSupply[id], totalSupplyShares[id]); - } + if (shares > 0) amount = shares.toAssetsDown(totalSupply[id], totalSupplyShares[id]); + else shares = amount.toSharesUp(totalSupply[id], totalSupplyShares[id]); supplyShares[id][onBehalf] -= shares; totalSupplyShares[id] -= shares; @@ -213,11 +207,8 @@ contract Blue is IBlue { _accrueInterests(market, id); - if (shares > 0) { - amount = shares.toAssetsDown(totalBorrow[id], totalBorrowShares[id]); - } else { - shares = amount.toSharesUp(totalBorrow[id], totalBorrowShares[id]); - } + if (shares > 0) amount = shares.toAssetsDown(totalBorrow[id], totalBorrowShares[id]); + else shares = amount.toSharesUp(totalBorrow[id], totalBorrowShares[id]); borrowShares[id][onBehalf] += shares; totalBorrowShares[id] += shares; @@ -241,11 +232,8 @@ contract Blue is IBlue { _accrueInterests(market, id); - if (shares > 0) { - amount = shares.toAssetsUp(totalBorrow[id], totalBorrowShares[id]); - } else { - shares = shares.toSharesDown(totalBorrow[id], totalBorrowShares[id]); - } + if (shares > 0) amount = shares.toAssetsUp(totalBorrow[id], totalBorrowShares[id]); + else shares = shares.toSharesDown(totalBorrow[id], totalBorrowShares[id]); borrowShares[id][onBehalf] -= shares; totalBorrowShares[id] -= shares;