Introduce a new scripting command setN that sets any number of elements at once, supports optional insertOnly flag and returns the array or hashmap that it operated:
ARRAY = ARRAY setN [INDEX_1, VALUE_1, ..., INDEX_N, VALUE_N, (BOOL insertOnly)]; HASHMAP = HASHMAP setN [KEY_1, VALUE_1, ..., KEY_N, VALUE_N, (BOOL insertOnly)];
- Better name idea - setN as in set N elements, in line with existing set command name
- Setting several elements in one go for performance gains
- No backwards compatibility issues, returns the array or hashmap that it operated
insertOnly should behave the same way as it does with current HASHMAP set behavior, optional and false by default, maybe also have it for arrays.