So if I have a large collection I’m cycling over and I want to reduce my cycle usage there are likely things I want to avoid. In Ethereum, writing a variable uses a bunch of gas so you try to avoid it. I don’t know what motoko does. Example:
if(thisItem.currentValue != newValue){ //changes are rare
thisItem.currentValue := newValue;
};
or
thisItem.currentValue := newValue;
Which likely uses more cycles? If writing uses the same number of cycles as comparing (say these are Nats) then I’ll just write it every time and forget the comparison. But maybe the comparison is expensive?