remove deadcode redundant length check