Skip to content

Commit 9c69d11

Browse files
lorenteymilseman
authored andcommitted
Remove _LegacyStringCore πŸŽ‰πŸŽ‰πŸŽ‰
1 parent c5b7a3d commit 9c69d11

File tree

8 files changed

+1
-992
lines changed

8 files changed

+1
-992
lines changed

β€Žstdlib/public/core/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ set(SWIFTLIB_ESSENTIAL
125125
StringBridge.swift
126126
StringBuffer.swift
127127
StringComparable.swift
128-
StringCore.swift
129128
StringGuts.swift
130129
StringObject.swift
131130
StringIndex.swift

β€Žstdlib/public/core/GroupInfo.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"StringBuffer.swift",
1616
"StringCharacterView.swift",
1717
"StringComparable.swift",
18-
"StringCore.swift",
1918
"StringObject.swift",
2019
"StringGuts.swift",
2120
"StringGraphemeBreaking.swift",

β€Žstdlib/public/core/String.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,6 @@ public struct String {
784784
init(_ _guts: _StringGuts) {
785785
self._guts = _guts
786786
}
787-
788-
public // @testable
789-
var _core: _LegacyStringCore {
790-
get { return _guts._legacyCore }
791-
set { self._guts = _StringGuts(newValue) }
792-
}
793787
}
794788

795789
extension String {

β€Žstdlib/public/core/StringBridge.swift

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -193,40 +193,6 @@ func _makeCocoaStringGuts(_ cocoaString: _CocoaString) -> _StringGuts {
193193
start: start)
194194
}
195195

196-
@inline(never) // Hide the CF dependency
197-
internal
198-
func makeCocoaLegacyStringCore(_cocoaString: AnyObject) -> _LegacyStringCore {
199-
if let wrapped = _cocoaString as? _NSContiguousString {
200-
return wrapped._core
201-
}
202-
203-
// "copy" it into a value to be sure nobody will modify behind
204-
// our backs. In practice, when value is already immutable, this
205-
// just does a retain.
206-
let cfImmutableValue
207-
= _stdlib_binary_CFStringCreateCopy(_cocoaString) as AnyObject
208-
209-
let length = _swift_stdlib_CFStringGetLength(cfImmutableValue)
210-
211-
// Look first for null-terminated ASCII
212-
// Note: the code in clownfish appears to guarantee
213-
// nul-termination, but I'm waiting for an answer from Chris Kane
214-
// about whether we can count on it for all time or not.
215-
let nulTerminatedASCII = _swift_stdlib_CFStringGetCStringPtr(
216-
cfImmutableValue, kCFStringEncodingASCII)
217-
218-
// start will hold the base pointer of contiguous storage, if it
219-
// is found.
220-
let (start, isUTF16) = _getCocoaStringPointer(cfImmutableValue)
221-
222-
return _LegacyStringCore(
223-
baseAddress: UnsafeMutableRawPointer(mutating: start),
224-
count: length,
225-
elementShift: isUTF16 ? 1 : 0,
226-
hasCocoaBuffer: true,
227-
owner: cfImmutableValue)
228-
}
229-
230196
extension String {
231197
public // SPI(Foundation)
232198
init(_cocoaString: AnyObject) {
@@ -405,11 +371,6 @@ public final class _NSContiguousString : _SwiftNativeNSString, _NSStringCore {
405371
}
406372
return try body(selfAsPointer, rhsAsPointer)
407373
}
408-
409-
public // @testable
410-
var _core: _LegacyStringCore {
411-
return _guts._legacyCore
412-
}
413374
}
414375

415376
extension String {

0 commit comments

Comments
Β (0)