Recomendation!
https://github.com/robertsimoes/Solidity-Contract-Patterns/blob/master/IndexedStructMap/IndexedStructMap.sol If I was u, I would develop update and add as one function, for example using
mapping(uint => address)
and have uint size; and write 2 maps and size in 1 struct; something like this:
struct eDataStruct {
mapping(address => Entity) entityStructs;
mapping(uint=>address) entityList;
uint size;
}
struct Entity {
uint eData;
bool exists;
}
using arrays in smart-contracts it's bad idea )
Thanks for the recco @idimon4uk, Interesting!!
Could you elaborate on why you think array's aren't the best idea?
it's my own opinion, I had some experience with arrays. it's too easy to update some data using map , and have some problem using arrays, for example 'out of gas'. it's depended from task