tools: remove unnecessary copy of array_lengthof