A note on the sum of distances under a diameter constraint