Hello! A question: I want to display a complete color palette, without repeats,

Hello!

A question: I want to display a complete color palette, without repeats, on a strip that is NUM_LEDS in length. I modified the function from the Kriegsman-Tuline palettecrossfade.ino like this:

void FillLEDsFromPaletteColors(uint8_t colorIndex) {
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = ColorFromPalette(currentPalette, map(i, 0, NUM_LEDS, 0, 240), 255);
}
}

(going only to 240 rather than 255 to keep from wrapping). This seems to work okay, but I suspect there is a better way to do it. Any thoughts?