Skip to content

Commit 89b4664

Browse files
author
Lance Parker
authored
Merge pull request #17674 from lancep/specialize_remaining_4.2
[stdlib]Specialize remaining 4.2 rdar://problem/41734165
2 parents bbaff83 + d1c99d1 commit 89b4664

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stdlib/public/core/NormalizedCodeUnitIterator.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ struct _NormalizedCodeUnitIterator: IteratorProtocol {
6363
where Source.Element == UInt16, Source.SubSequence == Source
6464
{
6565
var remaining: Int {
66-
return collection.distance(from: index, to: collection.endIndex)
66+
@_specialize(where Source == _UnmanagedString<UInt16>)
67+
@_specialize(where Source == _UnmanagedOpaqueString)
68+
get {
69+
return collection.distance(from: index, to: collection.endIndex)
70+
}
6771
}
6872
var collection: Source
6973
var index: Source.Index

0 commit comments

Comments
 (0)