Skip to content

Commit 2ff89aa

Browse files
committed
stdlib: fix comment on ArraySlice.startIndex
ArraySlice.startIndex is not necessarily zero anymore. rdar://22633052 Swift SVN r31921
1 parent 16bd644 commit 2ff89aa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/core/Arrays.swift.gyb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,13 @@ public struct ${Self}<Element>
172172
@available(*, unavailable, renamed="Element")
173173
public typealias T = Element
174174

175+
%if Self == 'ArraySlice':
176+
/// The position of the first element in a non-empty collection.
177+
///
178+
/// In an empty collection, `startIndex == endIndex`.
179+
%else:
175180
/// Always zero, which is the index of the first element when non-empty.
181+
%end
176182
public var startIndex: Int {
177183
%if Self == 'ArraySlice':
178184
return _buffer.startIndex

0 commit comments

Comments
 (0)