Skip to content

Commit 06bc577

Browse files
authored
[se0447] remove undesirable invisible characters (#2589)
1 parent 2ab2cf9 commit 06bc577

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

proposals/0447-span-access-shared-contiguous-storage.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ extension Span where Element: ~Copyable {
114114
public var count: Int { get }
115115

116116
/// A Boolean value indicating whether the span is empty.
117-
public var isEmpty: Bool { get }
117+
public var isEmpty: Bool { get }
118118

119119
/// The type that represents a position in `Span`.
120120
public typealias Index = Int
@@ -146,7 +146,7 @@ extension Span where Element: ~Copyable {
146146
}
147147
```
148148

149-
When using the unchecked subscript, the index must be known to be valid. While we are not proposing explicit index validation API on `Span` itself, its `indices` property can be use to validate a single index, in the form of the function `Range<Int>.contains(_: Int) -> Bool`. We expect that `Range` will also add efficient containment checking of a subrange's endpoints, which should be generally useful for index range validation in this and other contexts.
149+
When using the unchecked subscript, the index must be known to be valid. While we are not proposing explicit index validation API on `Span` itself, its `indices` property can be use to validate a single index, in the form of the function `Range<Int>.contains(_: Int) -> Bool`. We expect that `Range` will also add efficient containment checking of a subrange's endpoints, which should be generally useful for index range validation in this and other contexts.
150150

151151
##### Identifying whether a `Span` is a subrange of another:
152152

@@ -468,7 +468,7 @@ Of these, the closure-taking functions can be implemented now, but it is unclear
468468

469469
#### Index Validation Utilities
470470

471-
This proposal originally included index validation utilities for `Span`. such as `boundsContain(_: Index) -> Bool` and `boundsContain(_: Range<Index>) -> Bool`. After review feedback, we believe that the utilities proposed would also be useful for index validation on `UnsafeBufferPointer`, `Array`, and other similar `RandomAccessCollection` types. `Range` already a single-element `contains(_: Bound) -> Bool` function which can be made even more efficient. We should add an additional function that identifies whether a `Range` contains the _endpoints_ of another `Range`. Note that this is not the same as the existing `contains(_: some Collection<Bound>) -> Bool`, which is about the _elements_ of the collection. This semantic difference can lead to different results when examing empty `Range` instances.
471+
This proposal originally included index validation utilities for `Span`. such as `boundsContain(_: Index) -> Bool` and `boundsContain(_: Range<Index>) -> Bool`. After review feedback, we believe that the utilities proposed would also be useful for index validation on `UnsafeBufferPointer`, `Array`, and other similar `RandomAccessCollection` types. `Range` already a single-element `contains(_: Bound) -> Bool` function which can be made even more efficient. We should add an additional function that identifies whether a `Range` contains the _endpoints_ of another `Range`. Note that this is not the same as the existing `contains(_: some Collection<Bound>) -> Bool`, which is about the _elements_ of the collection. This semantic difference can lead to different results when examing empty `Range` instances.
472472

473473
#### <a name="ContiguousStorage"></a>A `ContiguousStorage` protocol
474474

0 commit comments

Comments
 (0)