From 28bdc1aef17613fdf1efdb4f7fddbecb2ed99e66 Mon Sep 17 00:00:00 2001 From: Papa Smurf Date: Mon, 8 Jan 2024 11:39:11 +0000 Subject: [PATCH] fix: use ++i instead of i++ --- contracts/StatusMap.sol | 6 +++--- contracts/VioletID.sol | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/StatusMap.sol b/contracts/StatusMap.sol index 290a0ad..f253dec 100644 --- a/contracts/StatusMap.sol +++ b/contracts/StatusMap.sol @@ -80,7 +80,7 @@ contract StatusMap { uint8[256] memory tempStatusArray; // iterate indices of bits as long as indicesMask has a value - for (uint8 i = 0; indicesMask > 0; i++) { + for (uint8 i = 0; indicesMask > 0; ++i) { // If statusCombination has a value at the current bit then a status is set, record it in temp array if (indicesMask & 1 != 0) { tempStatusArray[numberOfStatuses] = i; @@ -95,7 +95,7 @@ contract StatusMap { statuses = new uint8[](numberOfStatuses); // store values from temp array to new array - for (uint8 i = 0; i < numberOfStatuses; i++) { + for (uint8 i = 0; i < numberOfStatuses; ++i) { statuses[i] = tempStatusArray[i]; } } @@ -104,7 +104,7 @@ contract StatusMap { * @dev Calculates the `indicesMask` given a list of status indexes as `statusIds`. */ function getStatusCombinationId(uint8[] calldata statusIds) external pure returns (uint256 indicesMask) { - for (uint256 i = 0; i < statusIds.length; i++) { + for (uint256 i = 0; i < statusIds.length; ++i) { uint256 status = 1 << statusIds[i]; indicesMask += status; } diff --git a/contracts/VioletID.sol b/contracts/VioletID.sol index 20ebf8c..4ebfa66 100644 --- a/contracts/VioletID.sol +++ b/contracts/VioletID.sol @@ -177,7 +177,7 @@ contract VioletIDv1_4_0 is for (uint256 i = 0; i < length; ) { _overwriteMultipleStatuses(accountArray[i], statusCombinationIdArray[i]); unchecked { - i++; + ++i; } } }