Skip to content

Commit

Permalink
fix: replace if else with ternary operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff-CCH committed Jul 22, 2024
1 parent c9213ac commit 388488c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/logics/magicsea/logic.swap-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,7 @@ export class SwapTokenLogic
const resultGetPair = resultsGetPair[j];
if (resultGetPair.success && resultGetPair.returnData !== '0x') {
const [pairAddress] = iface.decodeFunctionResult('getPair', resultGetPair.returnData);
if (pairAddress === constants.AddressZero) pairAddresses.push(undefined);
else {
pairAddresses.push(pairAddress);
}
pairAddresses.push(pairAddress === constants.AddressZero ? undefined : pairAddress);
} else {
pairAddresses.push(undefined);
}
Expand Down

0 comments on commit 388488c

Please sign in to comment.