Serial.list() is a slow operation, and you call it for each loop, twice since you also call it in the loop condition!
Assign the result of Serial.list() to an array before doing the loop, and use this array instead.
Assign the result of Serial.list() to an array before doing the loop, and use this array instead.