From 74bd138cdeafea9293ec0b4d06e3f2ec2fba199d Mon Sep 17 00:00:00 2001 From: Domen Grabec Date: Thu, 5 Dec 2024 14:49:16 +0100 Subject: [PATCH] gas optimisation (#2322) --- contracts/contracts/token/OUSD.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/contracts/token/OUSD.sol b/contracts/contracts/token/OUSD.sol index f2339074b3..33a65ef3b6 100644 --- a/contracts/contracts/token/OUSD.sol +++ b/contracts/contracts/token/OUSD.sol @@ -392,8 +392,9 @@ contract OUSD is Governable { view returns (uint256) { - if (alternativeCreditsPerToken[_account] != 0) { - return alternativeCreditsPerToken[_account]; + uint256 alternativeCreditsPerTokenMem = alternativeCreditsPerToken[_account]; + if (alternativeCreditsPerTokenMem != 0) { + return alternativeCreditsPerTokenMem; } else { return rebasingCreditsPerToken_; }