aboutsummaryrefslogtreecommitdiffstats
path: root/contracts/protocol
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-12-20 06:35:28 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-12-21 01:11:30 +0800
commit99e32869e602e9b01d74048af23594986aa639a1 (patch)
tree0ad9ad45b41c0fc547c55213d5bd87874802b971 /contracts/protocol
parent04729c44b451bcf4818048621c890960bb7f8afb (diff)
downloaddexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.tar
dexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.tar.gz
dexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.tar.bz2
dexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.tar.lz
dexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.tar.xz
dexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.tar.zst
dexon-sol-tools-99e32869e602e9b01d74048af23594986aa639a1.zip
Use more efficient equality checks
Diffstat (limited to 'contracts/protocol')
-rw-r--r--contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol4
1 files changed, 2 insertions, 2 deletions
diff --git a/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol b/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol
index 5bc32c214..377325384 100644
--- a/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol
+++ b/contracts/protocol/contracts/protocol/AssetProxy/MultiAssetProxy.sol
@@ -148,7 +148,7 @@ contract MultiAssetProxy is
let nestedAssetDataLen := calldataload(sub(nestedAssetDataContentsStart, 32))
// Revert if number of elements in `amounts` differs from number of elements in `nestedAssetData`
- if iszero(eq(amountsLen, nestedAssetDataLen)) {
+ if sub(amountsLen, nestedAssetDataLen) {
// Revert with `Error("LENGTH_MISMATCH")`
mstore(0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
mstore(32, 0x0000002000000000000000000000000000000000000000000000000000000000)
@@ -236,7 +236,7 @@ contract MultiAssetProxy is
// Only load `assetProxy` if `currentAssetProxyId` does not equal `assetProxyId`
// We do not need to check if `currentAssetProxyId` is 0 since `assetProxy` is also initialized to 0
- if iszero(eq(currentAssetProxyId, assetProxyId)) {
+ if sub(currentAssetProxyId, assetProxyId) {
// Update `assetProxyId`
assetProxyId := currentAssetProxyId
// To lookup a value in a mapping, we load from the storage location keccak256(k, p),