Skip to content

Commit 6fee1b3

Browse files
committed
[stdlib] Breadcrumbs are spaced in UTF-16 code units, not UTF-8
1 parent 2423b8b commit 6fee1b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/StringUTF16View.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ extension String.UTF16View {
720720
///
721721
/// - Complexity: This measures the UTF-16 distance of `idx` from its nearest
722722
/// breadcrumb index (rounding down), so on average it needs to look at
723-
/// `breadcrumbStride / 2` UTF-8 code units. (In addition to the O(log(n))
723+
/// `breadcrumbStride / 2` UTF-16 code units. (In addition to the O(log(n))
724724
/// cost of looking up the nearest breadcrumb, and the amortizable O(n)
725725
/// cost of generating the breadcrumbs in the first place.)
726726
@usableFromInline
@@ -758,7 +758,7 @@ extension String.UTF16View {
758758
///
759759
/// - Complexity: This iterates UTF-16 code units starting from the
760760
/// nearest breadcrumb to `offset` (rounding down), so on
761-
/// average it needs to look at `breadcrumbStride / 2` UTF-8 code
761+
/// average it needs to look at `breadcrumbStride / 2` UTF-16 code
762762
/// units. (In addition to the O(1) cost of looking up the nearest
763763
/// breadcrumb, and the amortizable O(n) cost of generating the
764764
/// breadcrumbs in the first place.)

0 commit comments

Comments
 (0)