Skip to content

Commit fd02406

Browse files
committed
SQUASH ME: Unfortunate @_specialize addition.
_appendUTF16 is perhaps too general, and only getting partially specialized based on CodeUnit. This compounds with Character._SmallUTF16 not getting specialized produces a ton of silly witness table dispatches. This shaves off around 30% from StringEdits.
1 parent 0531f20 commit fd02406

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/core/StringStorage.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ extension _SwiftStringStorage {
222222

223223
@_inlineable
224224
@_versioned
225+
@_specialize(where C == Character._SmallUTF16, CodeUnit == UInt8)
225226
@nonobjc
226227
internal final func _appendInPlaceUTF16<C: Collection>(contentsOf other: C)
227228
where C.Element == UInt16 {

0 commit comments

Comments
 (0)