Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
srp_json and arrays
Within a loop is there an advantage in using "set" over "add" or vice versa when adding an object to an array?
Comments
I can't say for sure, but I would have expected ADD to be better since it does not have to track a pointer into the array nor worry about allocating elements of the array that are not referenced.
I wrote it using 'set', then switched it to 'add' when I noticed it in the doco but in all honesty, it's probably negligible in my current case. These arrays will probably rarely reach double figures.
Just thought I'd ask in case there was something I was missing.