@@ -683,7 +683,7 @@ extension RawSpan {
683
683
@_alwaysEmitIntoClient
684
684
@lifetime ( self )
685
685
public func _extracting( droppingLast k: Int ) -> Self {
686
- _precondition ( k >= 0 , " Can't drop a negative number of elements " )
686
+ _precondition ( k >= 0 , " Can't drop a negative number of bytes " )
687
687
let droppedCount = min ( k, byteCount)
688
688
return Self ( _unchecked: _pointer, byteCount: byteCount &- droppedCount)
689
689
}
@@ -709,7 +709,7 @@ extension RawSpan {
709
709
_precondition ( maxLength >= 0 , " Can't have a suffix of negative length " )
710
710
let newCount = min ( maxLength, byteCount)
711
711
let newStart = unsafe _pointer? . advanced ( by: byteCount &- newCount)
712
- let newSpan = RawSpan ( _unchecked: newStart, byteCount: newCount)
712
+ let newSpan = Self ( _unchecked: newStart, byteCount: newCount)
713
713
// As a trivial value, 'newStart' does not formally depend on the
714
714
// lifetime of 'self'. Make the dependence explicit.
715
715
return unsafe _override Lifetime ( newSpan, copying: self )
@@ -732,10 +732,10 @@ extension RawSpan {
732
732
@_alwaysEmitIntoClient
733
733
@lifetime ( self )
734
734
public func _extracting( droppingFirst k: Int ) -> Self {
735
- _precondition ( k >= 0 , " Can't drop a negative number of elements " )
736
- let droppedCount = min ( k, byteCount)
737
- let newStart = unsafe _pointer? . advanced ( by: droppedCount )
738
- let newSpan = RawSpan ( _unchecked: newStart, byteCount: byteCount &- droppedCount )
735
+ _precondition ( k >= 0 , " Can't drop a negative number of bytes " )
736
+ let dropped = min ( k, byteCount)
737
+ let newStart = unsafe _pointer? . advanced ( by: dropped )
738
+ let newSpan = Self ( _unchecked: newStart, byteCount: byteCount &- dropped )
739
739
// As a trivial value, 'newStart' does not formally depend on the
740
740
// lifetime of 'self'. Make the dependence explicit.
741
741
return unsafe _override Lifetime ( newSpan, copying: self )
0 commit comments