Skip to content

Commit 6c5ad1c

Browse files
author
Lance Parker
committed
Specialize remaining on _CollectionSource
1 parent f9ab5c8 commit 6c5ad1c

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)