Performance tweak
#6900 - swapping conditional to avoid eager function call
Merge branch 'feature/#6900-array-utils-performance-tweaks'

Close #6900