@@ -693,7 +693,7 @@ extension RawSpan {
693
693
@_alwaysEmitIntoClient
694
694
@lifetime ( self )
695
695
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 " )
697
697
let droppedCount = min ( k, byteCount)
698
698
return Self ( _unchecked: _pointer, byteCount: byteCount &- droppedCount)
699
699
}
@@ -719,7 +719,7 @@ extension RawSpan {
719
719
_precondition ( maxLength >= 0 , " Can't have a suffix of negative length " )
720
720
let newCount = min ( maxLength, byteCount)
721
721
let newStart = _pointer? . advanced ( by: byteCount &- newCount)
722
- let newSpan = RawSpan ( _unchecked: newStart, byteCount: newCount)
722
+ let newSpan = Self ( _unchecked: newStart, byteCount: newCount)
723
723
// As a trivial value, 'newStart' does not formally depend on the
724
724
// lifetime of 'self'. Make the dependence explicit.
725
725
return _overrideLifetime ( newSpan, copying: self )
@@ -742,10 +742,10 @@ extension RawSpan {
742
742
@_alwaysEmitIntoClient
743
743
@lifetime ( self )
744
744
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 )
749
749
// As a trivial value, 'newStart' does not formally depend on the
750
750
// lifetime of 'self'. Make the dependence explicit.
751
751
return _overrideLifetime ( newSpan, copying: self )
0 commit comments