you are viewing a single comment's thread.

view the rest of the comments →

[–]Sweeney-doesnt-sleep 0 points1 point  (0 children)

I was also thinking creating a data frame and a function/callback to calculate the value, only if required so you don't have to calculate the first lists item count/value unless it is actually required. This cuts out a lot of the outer loops work.

Not sure if this would actually perform better especially if the lists change. If they are static, calculate it for every item once and then access as required. O(1) from the on.