An alternative more efficient implementation of mapPartiali().