Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapping(address => MyStruct[]) public structs;
- structs[_user].length = 0; // will trigger an error !
- function _burn(uint index) internal {
- require(index < array.length);
- array[index] = array[array.length-1];
- delete array[array.length-1];
- // when array.length is set to 0 it doesn't work:
- array.length = array.length - 1; // doesn't work if array.length = 1
- array.length = 0; // doesn't work
- // when array.length is set to a value > 0 it works:
- array.length = 1; // works
- array.length = 2; // works
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement