File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ library LibDiamond {
8686 function _diamondCut (FacetCut[] memory _facetCuts , address _init , bytes memory _calldata ) internal {
8787 uint256 facetCutsLength = _facetCuts.length ;
8888 if (facetCutsLength == 0 ) revert NoFacetsInDiamondCut ();
89- for (uint256 facetIndex; facetIndex < facetCutsLength; facetIndex ++ ) {
89+ for (uint256 facetIndex; facetIndex < facetCutsLength;) {
9090 FacetCutAction action = _facetCuts[facetIndex].action;
9191 if (action == FacetCutAction.Add) {
9292 _addFunctions (_facetCuts[facetIndex].facetAddress, _facetCuts[facetIndex].functionSelectors);
@@ -97,6 +97,9 @@ library LibDiamond {
9797 } else {
9898 revert IncorrectFacetCutAction (uint8 (action));
9999 }
100+ unchecked {
101+ ++ facetIndex;
102+ }
100103 }
101104 emit DiamondCut (_facetCuts, _init, _calldata);
102105 _initializeDiamondCut (_init, _calldata);
You can’t perform that action at this time.
0 commit comments