fix compare two array types

consider the length of array