Skip to content

Commit a60d19e

Browse files
[NONEVM-3400] [CL86-18] Unnecessary Use Of replaceAndGetPrevious() #494
1 parent 8192ef2 commit a60d19e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

contracts/contracts/ccip/fee_quoter/contract.tolk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fun updateTokenTransferFeeConfigs(mutate st: Storage, msg: FeeQuoter_UpdateToken
134134
destChainConfig.tokenTransferFeeConfigs.delete(tokenAddr);
135135
}
136136

137-
st.destChainConfigs.replaceAndGetPrevious(destChainSelector, destChainConfig);
137+
st.destChainConfigs.replaceIfExists(destChainSelector, destChainConfig);
138138
}
139139
entry = msg.updates.iterateNext(entry);
140140
}
@@ -197,7 +197,7 @@ fun updatePrices(mutate st: Storage, priceUpdates: PriceUpdates) {
197197
dataAvailabilityGasPrice: update.dataAvailabilityGasPrice,
198198
timestamp
199199
}.toCell();
200-
st.destChainConfigs.replaceAndGetPrevious(update.destChainSelector, destChainConfig);
200+
st.destChainConfigs.replaceIfExists(update.destChainSelector, destChainConfig);
201201

202202
emit(USD_PER_UNIT_GAS_UPDATED, UsdPerUnitGasUpdated {
203203
destChainSelector: update.destChainSelector,

contracts/contracts/ccip/onramp/contract.tolk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ fun onApplyDestChainConfigUpdates(mutate st: OnRamp_Storage, updates: SnakedCell
394394
config = entry.loadValue();
395395
config.router = update.router;
396396
config.allowlistEnabled = update.allowlistEnabled;
397-
st.destChainConfigs.replaceAndGetPrevious(update.destChainSelector, config);
397+
st.destChainConfigs.replaceIfExists(update.destChainSelector, config);
398398
} else {
399399
config = OnRamp_DestChainConfig {
400400
router: update.router,

0 commit comments

Comments
 (0)