Skip to content

Commit af4ae60

Browse files
authored
Add availability for diffing implementation (#84438)
The diffing implementation traffics in CollectionDifference elements, which are availability gated. This adds the correct availability for those APIs. rdar://161010205
1 parent 261a412 commit af4ae60

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/core/Diffing.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ fileprivate struct LinearMyers: ~Copyable {
348348
/// Implements a refinement of the Myers diffing algorithm that uses
349349
/// linear space for storing the "k vectors" during an iterative divide-
350350
/// and-conquer search.
351+
@available(SwiftStdlib 5.1, *)
351352
mutating func findDifferences<T>(
352353
in initial: EditGraphRect,
353354
old: UnsafeBufferPointer<T>,
@@ -391,6 +392,7 @@ fileprivate struct LinearMyers: ~Copyable {
391392
fatalError("Unreachable")
392393
}
393394

395+
@available(SwiftStdlib 5.1, *)
394396
fileprivate mutating func middleSnake<T>(
395397
in box: EditGraphRect,
396398
old: UnsafeBufferPointer<T>, new: UnsafeBufferPointer<T>,
@@ -431,6 +433,7 @@ fileprivate struct LinearMyers: ~Copyable {
431433
fatalError("Unreachable")
432434
}
433435

436+
@available(SwiftStdlib 5.1, *)
434437
fileprivate mutating func forwardSearch<T>(
435438
in box: EditGraphRect,
436439
depth: Int,
@@ -502,6 +505,7 @@ fileprivate struct LinearMyers: ~Copyable {
502505
return nil
503506
}
504507

508+
@available(SwiftStdlib 5.1, *)
505509
fileprivate mutating func backwardSearch<T>(
506510
in box: EditGraphRect,
507511
depth: Int,
@@ -583,6 +587,7 @@ extension LinearMyers {
583587
}
584588
}
585589

590+
@available(SwiftStdlib 5.1, *)
586591
func _linearSpaceMyers<C,D>(
587592
from old: C, to new: D,
588593
using cmp: (C.Element, D.Element) -> Bool

0 commit comments

Comments
 (0)