Skip to content

Commit 57345f7

Browse files
committed
[span] remove _shrink functions added for review purposes
1 parent b508206 commit 57345f7

File tree

2 files changed

+0
-100
lines changed

2 files changed

+0
-100
lines changed

stdlib/public/core/Span/RawSpan.swift

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,6 @@ extension RawSpan {
258258
return _extracting(unchecked: bounds)
259259
}
260260

261-
@_disallowFeatureSuppression(NonescapableTypes)
262-
@_alwaysEmitIntoClient
263-
public mutating func _shrink(to bounds: Range<Int>) {
264-
self = _extracting(bounds)
265-
}
266-
267261
/// Constructs a new span over the bytes within the supplied range of
268262
/// positions within this span.
269263
///
@@ -289,13 +283,6 @@ extension RawSpan {
289283
)
290284
}
291285

292-
@_disallowFeatureSuppression(NonescapableTypes)
293-
@unsafe
294-
@_alwaysEmitIntoClient
295-
public mutating func _shrink(toUnchecked bounds: Range<Int>) {
296-
self = _extracting(unchecked: bounds)
297-
}
298-
299286
/// Constructs a new span over the bytes within the supplied range of
300287
/// positions within this span.
301288
///
@@ -315,12 +302,6 @@ extension RawSpan {
315302
_extracting(bounds.relative(to: byteOffsets))
316303
}
317304

318-
@_disallowFeatureSuppression(NonescapableTypes)
319-
@_alwaysEmitIntoClient
320-
public mutating func _shrink(_ bounds: some RangeExpression<Int>) {
321-
self = _extracting(bounds)
322-
}
323-
324305
/// Constructs a new span over the bytes within the supplied range of
325306
/// positions within this span.
326307
///
@@ -345,13 +326,6 @@ extension RawSpan {
345326
_extracting(unchecked: bounds.relative(to: byteOffsets))
346327
}
347328

348-
@_disallowFeatureSuppression(NonescapableTypes)
349-
@unsafe
350-
@_alwaysEmitIntoClient
351-
public mutating func _shrink(toUnchecked bounds: some RangeExpression<Int>) {
352-
self = _extracting(unchecked: bounds)
353-
}
354-
355329
/// Constructs a new span over all the bytes of this span.
356330
///
357331
/// The returned span's first byte is always at offset 0; unlike buffer
@@ -606,12 +580,6 @@ extension RawSpan {
606580
return Self(_unchecked: _pointer, byteCount: newCount)
607581
}
608582

609-
@_disallowFeatureSuppression(NonescapableTypes)
610-
@_alwaysEmitIntoClient
611-
public mutating func _shrink(toFirst maxLength: Int) {
612-
self = _extracting(first: maxLength)
613-
}
614-
615583
/// Returns a span over all but the given number of trailing bytes.
616584
///
617585
/// If the number of elements to drop exceeds the number of elements in
@@ -634,12 +602,6 @@ extension RawSpan {
634602
return Self(_unchecked: _pointer, byteCount: byteCount&-dc)
635603
}
636604

637-
@_disallowFeatureSuppression(NonescapableTypes)
638-
@_alwaysEmitIntoClient
639-
public mutating func _shrink(droppingLast k: Int) {
640-
self = _extracting(droppingLast: k)
641-
}
642-
643605
/// Returns a span containing the trailing bytes of the span,
644606
/// up to the given maximum length.
645607
///
@@ -664,12 +626,6 @@ extension RawSpan {
664626
return Self(_unchecked: newStart, byteCount: newCount)
665627
}
666628

667-
@_disallowFeatureSuppression(NonescapableTypes)
668-
@_alwaysEmitIntoClient
669-
public mutating func _shrink(toLast maxLength: Int) {
670-
self = _extracting(last: maxLength)
671-
}
672-
673629
/// Returns a span over all but the given number of initial bytes.
674630
///
675631
/// If the number of elements to drop exceeds the number of bytes in
@@ -692,10 +648,4 @@ extension RawSpan {
692648
let newStart = _pointer?.advanced(by: dc)
693649
return Self(_unchecked: newStart, byteCount: byteCount&-dc)
694650
}
695-
696-
@_disallowFeatureSuppression(NonescapableTypes)
697-
@_alwaysEmitIntoClient
698-
public mutating func _shrink(droppingFirst k: Int) {
699-
self = _extracting(droppingFirst: k)
700-
}
701651
}

stdlib/public/core/Span/Span.swift

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -504,12 +504,6 @@ extension Span where Element: ~Copyable {
504504
return _extracting(unchecked: bounds)
505505
}
506506

507-
@_disallowFeatureSuppression(NonescapableTypes)
508-
@_alwaysEmitIntoClient
509-
public mutating func _shrink(to bounds: Range<Index>) {
510-
self = _extracting(bounds)
511-
}
512-
513507
/// Constructs a new span over the items within the supplied range of
514508
/// positions within this span.
515509
///
@@ -533,13 +527,6 @@ extension Span where Element: ~Copyable {
533527
return Span(_unchecked: _pointer?.advanced(by: delta), count: bounds.count)
534528
}
535529

536-
@_disallowFeatureSuppression(NonescapableTypes)
537-
@unsafe
538-
@_alwaysEmitIntoClient
539-
public mutating func _shrink(toUnchecked bounds: Range<Index>) {
540-
self = _extracting(unchecked: bounds)
541-
}
542-
543530
/// Constructs a new span over the items within the supplied range of
544531
/// positions within this span.
545532
///
@@ -559,12 +546,6 @@ extension Span where Element: ~Copyable {
559546
_extracting(bounds.relative(to: indices))
560547
}
561548

562-
@_disallowFeatureSuppression(NonescapableTypes)
563-
@_alwaysEmitIntoClient
564-
public mutating func _shrink(to bounds: some RangeExpression<Int>) {
565-
self = _extracting(bounds)
566-
}
567-
568549
/// Constructs a new span over the items within the supplied range of
569550
/// positions within this span.
570551
///
@@ -589,13 +570,6 @@ extension Span where Element: ~Copyable {
589570
_extracting(unchecked: bounds.relative(to: indices))
590571
}
591572

592-
@_disallowFeatureSuppression(NonescapableTypes)
593-
@unsafe
594-
@_alwaysEmitIntoClient
595-
public mutating func _shrink(toUnchecked bounds: some RangeExpression<Int>) {
596-
self = _extracting(uncheckedBounds: bounds)
597-
}
598-
599573
/// Constructs a new span over all the items of this span.
600574
///
601575
/// The returned span's first item is always at offset 0; unlike buffer
@@ -736,12 +710,6 @@ extension Span where Element: ~Copyable {
736710
return Self(_unchecked: _pointer, count: newCount)
737711
}
738712

739-
@_disallowFeatureSuppression(NonescapableTypes)
740-
@_alwaysEmitIntoClient
741-
public mutating func _shrink(toFirst maxLength: Int) {
742-
self = _extracting(first: maxLength)
743-
}
744-
745713
/// Returns a span over all but the given number of trailing elements.
746714
///
747715
/// If the number of elements to drop exceeds the number of elements in
@@ -764,12 +732,6 @@ extension Span where Element: ~Copyable {
764732
return Self(_unchecked: _pointer, count: count&-droppedCount)
765733
}
766734

767-
@_disallowFeatureSuppression(NonescapableTypes)
768-
@_alwaysEmitIntoClient
769-
public mutating func _shrink(droppingLast k: Int) {
770-
self = _extracting(droppingLast: k)
771-
}
772-
773735
/// Returns a span containing the final elements of the span,
774736
/// up to the given maximum length.
775737
///
@@ -794,12 +756,6 @@ extension Span where Element: ~Copyable {
794756
return Self(_unchecked: newStart, count: newCount)
795757
}
796758

797-
@_disallowFeatureSuppression(NonescapableTypes)
798-
@_alwaysEmitIntoClient
799-
public mutating func _shrink(toLast maxLength: Int) {
800-
self = _extracting(last: maxLength)
801-
}
802-
803759
/// Returns a span over all but the given number of initial elements.
804760
///
805761
/// If the number of elements to drop exceeds the number of elements in
@@ -822,10 +778,4 @@ extension Span where Element: ~Copyable {
822778
let newStart = _pointer?.advanced(by: droppedCount*MemoryLayout<Element>.stride)
823779
return Self(_unchecked: newStart, count: count&-droppedCount)
824780
}
825-
826-
@_disallowFeatureSuppression(NonescapableTypes)
827-
@_alwaysEmitIntoClient
828-
public mutating func _shrink(droppingFirst k: Int) {
829-
self = _extracting(droppingFirst: k)
830-
}
831781
}

0 commit comments

Comments
 (0)