However it could be done to limit the number of iterations of a loop to 256, but I would prefer using an explicit check for this. For example before the loop starts: require(_installationTypes.length < 257, "Two many installations");
Note: Using smaller uints is a gas optimization when packing structs that are stored in contract storage.
It is unnecessary and costs more gas to use smaller sized uints for local variables. The reason is because EVMs native uint size is uint256.
It is done in some places in the InstallationFacet:
https://github.com/aavegotchi/aavegotchi-realm-diamond/blob/dev/contracts/InstallationDiamond/facets/InstallationFacet.sol#L196
However it could be done to limit the number of iterations of a loop to 256, but I would prefer using an explicit check for this. For example before the loop starts:
require(_installationTypes.length < 257, "Two many installations");
Note: Using smaller uints is a gas optimization when packing structs that are stored in contract storage.