stop early in linear search