optimized unpack assignment by using ternary to check if the container is an Array.