Merge pull request #82599 from valeriyvan/WarningDiffingMyers

Fix warning in benchmark: generic parameter 'C' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
This commit is contained in:
eeckstein
2025-07-01 13:44:36 +02:00
committed by GitHub

View File

@@ -187,9 +187,9 @@ fileprivate func myers<C,D>(
* necessary) is significantly less than the worst-case n² memory use of the * necessary) is significantly less than the worst-case n² memory use of the
* descent algorithm. * descent algorithm.
*/ */
func _withContiguousStorage<C : Collection, R>( func _withContiguousStorage<Col : Collection, R>(
for values: C, for values: Col,
_ body: (UnsafeBufferPointer<C.Element>) throws -> R _ body: (UnsafeBufferPointer<Col.Element>) throws -> R
) rethrows -> R { ) rethrows -> R {
if let result = try values.withContiguousStorageIfAvailable(body) { return result } if let result = try values.withContiguousStorageIfAvailable(body) { return result }
let array = ContiguousArray(values) let array = ContiguousArray(values)