Skip to content

Commit

Permalink
style: remove brackets if else
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Aug 9, 2023
1 parent 2b4e3f3 commit 0898a8d
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions src/Blue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0898a8d

Please sign in to comment.