I had this one
staring me in the face most of today before I finally realized what it was...
Sometimes code like that is convenient during testing. If you're not sure the First Call does the job, the Boolean is a quick way to test by switching between "always true" and "first time true".
I'd at least make it a control. Then I can set it to true while running, and it will reset to false next time I load the code. So if I forget to remove it, at least it won't do anything.
Of course it should be removed after testing. But I feel this could be a "left over from testing" instead of "Rube Goldberg".
I am not going to repeat the entire discussion here, but the collective efforts of a few community members was able to iteratively speed this code up ~30000x (from 5 minute to a few ms) and literally reduce it to the size of a postage stamp. 😄
To add a single point to a chart, we apparently need to (1) take a subset containing one element, then (2) turn it into a 2D array with one element, before (3) feeding it to the chart. Repeat for four other charts. (Seen here).
I can think of something slightly simpler. 😄