Skip to content

Commit 3762019

Browse files
committed
edits in motivation
1 parent 88329b1 commit 3762019

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposals/NNNN-non-escapable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ This feature is a key requirement for the proposed `Span` type.
3030
## Motivation
3131

3232
Swift's current notion of an "iterator" has several weaknesses that become apparent when you try to use it in extremely performance-constrained environments.
33-
These weaknesses arise from the desire to ensure safety while simultaneously allowing iterator values to be arbitrarily copied to support multi-iterator algorithms.
33+
These weaknesses arise from the desire to ensure safety while simultaneously allowing iterator values to be arbitrarily copied in support of multi-iterator algorithms.
3434

35-
For example, the standard library iterator for Array logically creates a copy of the Array when it is constructed; this ensures that changes to the array cannot affect the iteration.
35+
For example, the standard library iterator for Array logically creates a copy of the Array when it is initialized; this ensures that changes to the array cannot affect the iteration.
3636
This is implemented by having the iterator store a reference-counted pointer to the array storage in order to ensure that the storage cannot be freed while the iterator is active.
3737
These safety checks all incur runtime overhead.
3838

0 commit comments

Comments
 (0)