Skip to content

Commit 3b9ec94

Browse files
authored
Merge pull request #82102 from valeriyvan/span
Fix parameter, doc comments in Span family
2 parents 665515c + b1082d4 commit 3b9ec94

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

stdlib/public/core/Span/MutableRawSpan.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ extension MutableRawSpan {
238238
@unsafe
239239
@_alwaysEmitIntoClient
240240
public func unsafeLoad<T>(
241-
fromByteOffset offset: Int = 0, as: T.Type
241+
fromByteOffset offset: Int = 0, as type: T.Type
242242
) -> T {
243243
_precondition(
244244
UInt(bitPattern: offset) <= UInt(bitPattern: _count) &&
@@ -269,7 +269,7 @@ extension MutableRawSpan {
269269
@unsafe
270270
@_alwaysEmitIntoClient
271271
public func unsafeLoad<T>(
272-
fromUncheckedByteOffset offset: Int, as: T.Type
272+
fromUncheckedByteOffset offset: Int, as type: T.Type
273273
) -> T {
274274
unsafe _start().load(fromByteOffset: offset, as: T.self)
275275
}
@@ -293,7 +293,7 @@ extension MutableRawSpan {
293293
@unsafe
294294
@_alwaysEmitIntoClient
295295
public func unsafeLoadUnaligned<T: BitwiseCopyable>(
296-
fromByteOffset offset: Int = 0, as: T.Type
296+
fromByteOffset offset: Int = 0, as type: T.Type
297297
) -> T {
298298
_precondition(
299299
UInt(bitPattern: offset) <= UInt(bitPattern: _count) &&
@@ -323,7 +323,7 @@ extension MutableRawSpan {
323323
@unsafe
324324
@_alwaysEmitIntoClient
325325
public func unsafeLoadUnaligned<T: BitwiseCopyable>(
326-
fromUncheckedByteOffset offset: Int, as: T.Type
326+
fromUncheckedByteOffset offset: Int, as type: T.Type
327327
) -> T {
328328
unsafe _start().loadUnaligned(fromByteOffset: offset, as: T.self)
329329
}

stdlib/public/core/Span/RawSpan.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ extension RawSpan {
288288

289289
/// Unsafely create a `RawSpan` over initialized memory.
290290
///
291-
/// The region of memory representing `byteCount` bytes starting at `pointer`
291+
/// The region of memory representing `count` elements starting at `pointer`
292292
/// must remain valid, initialized and immutable
293293
/// throughout the lifetime of the newly-created `RawSpan`.
294294
/// Failure to maintain this invariant results in undefined behaviour.
295295
///
296296
/// - Parameters:
297297
/// - pointer: a pointer to the first initialized byte.
298-
/// - byteCount: the number of initialized bytes in the span.
298+
/// - count: the number of initialized elements in the span.
299299
@unsafe
300300
@_alwaysEmitIntoClient
301301
@lifetime(borrow pointer)
@@ -561,7 +561,7 @@ extension RawSpan {
561561
@unsafe
562562
@_alwaysEmitIntoClient
563563
public func unsafeLoad<T>(
564-
fromByteOffset offset: Int = 0, as: T.Type
564+
fromByteOffset offset: Int = 0, as type: T.Type
565565
) -> T {
566566
_precondition(
567567
UInt(bitPattern: offset) <= UInt(bitPattern: _count) &&
@@ -592,7 +592,7 @@ extension RawSpan {
592592
@unsafe
593593
@_alwaysEmitIntoClient
594594
public func unsafeLoad<T>(
595-
fromUncheckedByteOffset offset: Int, as: T.Type
595+
fromUncheckedByteOffset offset: Int, as type: T.Type
596596
) -> T {
597597
unsafe _start().load(fromByteOffset: offset, as: T.self)
598598
}
@@ -616,7 +616,7 @@ extension RawSpan {
616616
@unsafe
617617
@_alwaysEmitIntoClient
618618
public func unsafeLoadUnaligned<T: BitwiseCopyable>(
619-
fromByteOffset offset: Int = 0, as: T.Type
619+
fromByteOffset offset: Int = 0, as type: T.Type
620620
) -> T {
621621
_precondition(
622622
UInt(bitPattern: offset) <= UInt(bitPattern: _count) &&
@@ -648,7 +648,7 @@ extension RawSpan {
648648
@unsafe
649649
@_alwaysEmitIntoClient
650650
public func unsafeLoadUnaligned<T: BitwiseCopyable>(
651-
fromUncheckedByteOffset offset: Int, as: T.Type
651+
fromUncheckedByteOffset offset: Int, as type: T.Type
652652
) -> T {
653653
unsafe _start().loadUnaligned(fromByteOffset: offset, as: T.self)
654654
}
@@ -664,14 +664,14 @@ extension RawSpan {
664664
unsafe (self._pointer == other._pointer) && (self._count == other._count)
665665
}
666666

667-
/// Returns the offsets where the memory of `span` is located within
667+
/// Returns the offsets where the memory of `other` is located within
668668
/// the memory represented by `self`
669669
///
670-
/// Note: `span` must be a subrange of `self`
670+
/// Note: `other` must be a subrange of `self`
671671
///
672-
/// Parameters:
673-
/// - span: a subrange of `self`
674-
/// Returns: A range of offsets within `self`
672+
/// - Parameters:
673+
/// - other: a subrange of `self`
674+
/// - Returns: A range of offsets within `self`
675675
@_alwaysEmitIntoClient
676676
public func byteOffsets(of other: borrowing Self) -> Range<Int>? {
677677
if other._count > _count { return nil }

stdlib/public/core/Span/Span.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,12 @@ extension Span where Element: ~Copyable {
714714
unsafe (self._pointer == other._pointer) && (self._count == other._count)
715715
}
716716

717-
/// Returns the indices within `self` where the memory represented by `span`
718-
/// is located, or `nil` if `span` is not located within `self`.
717+
/// Returns the indices within `self` where the memory represented by `other`
718+
/// is located, or `nil` if `other` is not located within `self`.
719719
///
720-
/// Parameters:
721-
/// - span: a span that may be a subrange of `self`
722-
/// Returns: A range of indices within `self`, or `nil`
720+
/// - Parameters:
721+
/// - other: a span that may be a subrange of `self`
722+
/// - Returns: A range of indices within `self`, or `nil`
723723
@_alwaysEmitIntoClient
724724
public func indices(of other: borrowing Self) -> Range<Index>? {
725725
if other._count > _count { return nil }

0 commit comments

Comments
 (0)