I never liked those "if" statements! "IF"? Why is there an "if"? It implies you're uncertain, or have hesitations, doubts even? That's rookie shit. I never do. Straight and happy path for this cowboy, always.
So being unsure about how many times you want to do a thing is a no-go too.
If the trip count isn't known at compile time? You should find out.