Skip to content

Commit c606370

Browse files
committed
- add _assumeNonNegative to Span.count
1 parent 5064297 commit c606370

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/Span/Span.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ extension Span where Element: ~Copyable {
391391
/// - Complexity: O(1)
392392
@_alwaysEmitIntoClient
393393
@_semantics("fixed_storage.get_count")
394-
public var count: Int { _count }
394+
public var count: Int { _assumeNonNegative(_count) }
395395

396396
/// A Boolean value indicating whether the span is empty.
397397
///
@@ -408,7 +408,7 @@ extension Span where Element: ~Copyable {
408408
/// - Complexity: O(1)
409409
@_alwaysEmitIntoClient
410410
public var indices: Range<Index> {
411-
unsafe Range(_uncheckedBounds: (0, _count))
411+
unsafe Range(_uncheckedBounds: (0, count))
412412
}
413413
}
414414

0 commit comments

Comments
 (0)