Skip to content

Commit e137da5

Browse files
authored
Merge pull request #15730 from rudkx/rdar33781464
stdlib: Collapse some multi-line closures to single-line closures.
2 parents 6df8732 + 32d006d commit e137da5

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift.gyb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ self.test("\(testNamePrefix)._withUnsafeMutableBufferPointerIfSupported()/semant
446446
var c = makeWrappedCollection(test.collection)
447447
var result = c._withUnsafeMutableBufferPointerIfSupported {
448448
(bufferPointer) -> OpaqueValue<Array<OpaqueValue<Int>>> in
449-
let value = OpaqueValue(bufferPointer.map(extractValue))
450-
return value
449+
return OpaqueValue(bufferPointer.map(extractValue))
451450
}
452451
expectType(Optional<OpaqueValue<Array<OpaqueValue<Int>>>>.self, &result)
453452
if withUnsafeMutableBufferPointerIsSupported {

stdlib/public/core/Arrays.swift.gyb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,7 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol {
16401640
) rethrows -> R? {
16411641
return try withUnsafeMutableBufferPointer {
16421642
(bufferPointer) -> R in
1643-
let r = try body(&bufferPointer)
1644-
return r
1643+
return try body(&bufferPointer)
16451644
}
16461645
}
16471646

test/stdlib/Inputs/CommonArrayTests.gyb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,7 @@ ${Suite}.test("${ArrayType}/_withUnsafeMutableBufferPointerIfSupported")
274274
// Read.
275275
var result = a._withUnsafeMutableBufferPointerIfSupported {
276276
(bufferPointer) -> OpaqueValue<[OpaqueValue<Int>]> in
277-
let r = OpaqueValue(Array(bufferPointer))
278-
return r
277+
return OpaqueValue(Array(bufferPointer))
279278
}
280279
expectType(Optional<OpaqueValue<Array<OpaqueValue<Int>>>>.self, &result)
281280
expectEqualSequence(test.sequence, result!.value.map { $0.value })

0 commit comments

Comments
 (0)