Clearer to write this as `for (i <- 0 until maxPartitions)`; same with the foreach over a range below