Skip to content

Commit b94cff7

Browse files
amartini51Quinn
andcommitted
Use an example that has more obvious invalid state
Co-authored-by: Quinn <[email protected]>
1 parent 6aea603 commit b94cff7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TSPL.docc/LanguageGuide/Concurrency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,8 +1107,8 @@ the code below converts measured temperatures from Fahrenheit to Celsius:
11071107
```swift
11081108
extension TemperatureLogger {
11091109
func convertFahrenheitToCelsius() {
1110-
measurements = measurements.map { measurement in
1111-
(measurement - 32) * 5 / 9
1110+
for i in measurements.indices {
1111+
measurements[i] = (measurements[i] - 32) * 5 / 9
11121112
}
11131113
}
11141114
}

0 commit comments

Comments
 (0)