I have a question is there an alternative to remove an item from an array in solidity apart from delete

Jan 7, 2023, 11:34 PM
you can override the index
Jan 7, 2023, 11:48 PM
Yes I do this but there just sometimes you need to remove a value from an array totally
What I did before was swap the index I want to remove with the last index and call pop but this actually costs a lot of gas
Jan 7, 2023, 11:51 PM

© 2024 Draquery.com All rights reserved.