Decrease complexity (conditions) in arraysAreSimilar function

Signed-off-by: Fabien Crassat <fabien@crassat.com>