Would it be possible to increase all the values of a mapping or array (without a loop)?
Example:
mapping(address => uint) score;
uint[] values;
function increase_scores() public {
// Example pseudo-code for mapping and array:
score.all += 1; // ??
values += 1; // Ex.Something like the python map(lambda x: x+1,list) ??
}
Edit: To provide more context, I have a mapping with users and scores. Every time I call the function increase_scores, I would like to increase the score of all the users of the mapping. Therefore, I wouldnt want to loop on the full array as I may run out of gas, if there are many users.
Edit: The map example of python is also not a good idea as at the end as it has to iterate over all the array or mapping..it will run out of gas too. There is no difference with the loop.