FastLED Choking

I've got a simple script here where I cycle 1 to many white lights throughout a strand of red lights... Think of this as a clock hand spinning around the face, the hand being different widths. When the widths (size) is set from 1 to 4, there's no problem. Set the size to 5 or more and FastLED seems to hang. By the way, the script in the loop works properly using the Adafruit_WS2801 library, but FastLED offers much, much more - brightness control initially. Thanks for any help provided.

#include "FastLED.h"

#define NUM_LEDS 20
#define DATA_PIN 2
#define CLOCK_PIN 3
CRGB leds[NUM_LEDS];

void setup() {
  delay(2000);
  FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  FastLED.setBrightness(5);
}

void loop() {
  int size = 4; // Setting size from 1 to 4 works
  // int size = 5; // Setting size to 5 or more does not work
  
  bool firstRun = true;
  int i, j;
  uint8_t wait = 100;
  while (0 == 0) {
    for (i=0; i < NUM_LEDS; i++) {
        leds[i] = CRGB::White;
        FastLED.show();
        if (i == 0 && size == 1 && firstRun == false) leds[NUM_LEDS - 1] = CRGB::Red;
        else if (i > 0 && size == 1) leds[i - 1] = CRGB::Red;
        else if (i == 0 && size > 1 && firstRun == false) leds[NUM_LEDS - size] = CRGB::Red;
        else if (i > 0 && size > 1) {
          if (i < size && firstRun == false) leds[NUM_LEDS - size + i] = CRGB::Red;
          leds[i - size] = CRGB::Red;
        }
        FastLED.show();
        delay(wait);
    }
    firstRun = false;
  }
}

You seem to have made the code over complex in its structure.
Forget the infinite while loop and let the loop function do the loop forever bit.
Move the first run code into the setup function so it only runs once.

I suspect that you are writing into an array beyond the memory reserved for it and when using the Adafruit library you just happen to get away stamping over some other variable.

Once you have cleaned up the code use Serial.print statements to look at variables and the point where the code seems to you to "hang".

Thanks for the input on this. Discovered I was setting lights that were < 0 with this line:

leds[i - size] = CRGB::Red;

Checked that with this:
if (i >= size) leds[i - size] = CRGB::Red;

No more issues.