Skip to content

Commit 8e4a8bb

Browse files
committed
[stdlib] small spelling fixes
1 parent 80a7aef commit 8e4a8bb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/public/core/Span/RawSpan.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ extension RawSpan {
693693
@_alwaysEmitIntoClient
694694
@lifetime(self)
695695
public func _extracting(droppingLast k: Int) -> Self {
696-
_precondition(k >= 0, "Can't drop a negative number of elements")
696+
_precondition(k >= 0, "Can't drop a negative number of bytes")
697697
let droppedCount = min(k, byteCount)
698698
return Self(_unchecked: _pointer, byteCount: byteCount &- droppedCount)
699699
}
@@ -719,7 +719,7 @@ extension RawSpan {
719719
_precondition(maxLength >= 0, "Can't have a suffix of negative length")
720720
let newCount = min(maxLength, byteCount)
721721
let newStart = _pointer?.advanced(by: byteCount &- newCount)
722-
let newSpan = RawSpan(_unchecked: newStart, byteCount: newCount)
722+
let newSpan = Self(_unchecked: newStart, byteCount: newCount)
723723
// As a trivial value, 'newStart' does not formally depend on the
724724
// lifetime of 'self'. Make the dependence explicit.
725725
return _overrideLifetime(newSpan, copying: self)
@@ -742,10 +742,10 @@ extension RawSpan {
742742
@_alwaysEmitIntoClient
743743
@lifetime(self)
744744
public func _extracting(droppingFirst k: Int) -> Self {
745-
_precondition(k >= 0, "Can't drop a negative number of elements")
746-
let droppedCount = min(k, byteCount)
747-
let newStart = _pointer?.advanced(by: droppedCount)
748-
let newSpan = RawSpan(_unchecked: newStart, byteCount: byteCount &- droppedCount)
745+
_precondition(k >= 0, "Can't drop a negative number of bytes")
746+
let dropped = min(k, byteCount)
747+
let newStart = _pointer?.advanced(by: dropped)
748+
let newSpan = Self(_unchecked: newStart, byteCount: byteCount &- dropped)
749749
// As a trivial value, 'newStart' does not formally depend on the
750750
// lifetime of 'self'. Make the dependence explicit.
751751
return _overrideLifetime(newSpan, copying: self)

0 commit comments

Comments
 (0)