why we need this special case for length == 1? Is it for addressing perf issues?