Optimize rest parameters.