SCEV: Use range-based for loop and fold variable into assert.