Skip to content

Commit

Permalink
fix: use ++i instead of i++
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpApaSmURf committed Jan 8, 2024
1 parent f5ef410 commit 28bdc1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions contracts/StatusMap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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];
}
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/VioletID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ contract VioletIDv1_4_0 is
for (uint256 i = 0; i < length; ) {
_overwriteMultipleStatuses(accountArray[i], statusCombinationIdArray[i]);
unchecked {
i++;
++i;
}
}
}
Expand Down

0 comments on commit 28bdc1a

Please sign in to comment.