Fixed #23968 -- Replace list comprehension with generator comprehension when possible

Would options.extend() work here (and below)? I think that would be more readable.