Swifters,
I'm eliminating for loops that use C-style syntax (initialize; terminate; increment), and I don't know if I'm doing it right for for loops that iterate in reverse (e.g., decrement). For example, I have a for loop over integers where startIndex is greater than endIndex, and iterates downward like this:
for (var i = startIndex - 1; i >= endIndex; --i) {
Is the best practice to use reverse()? For example:
for i in (endIndex...(startIndex - 1)).reverse() {
And if that might be right, this modest optimization:
for i in (endIndex..<startIndex).reverse() {
Thanks in advance!