Skip to content

Commit 28f662b

Browse files
committed
Reuse the same outValue to avoid breaking NRVO
1 parent e66c901 commit 28f662b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

stdlib/public/runtime/ReflectionMirror.mm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,7 @@ static AnyReturn copyFieldContents(OpaqueValue *fieldData,
199199
// Clean up the buffer allocated above
200200
type->deallocateBufferIn(&outValue.Buffer);
201201
// Return an existential containing Void
202-
Any emptyOutValue;
203-
emptyOutValue.Type = &METADATA_SYM(EMPTY_TUPLE_MANGLING);
204-
return AnyReturn(emptyOutValue);
202+
outValue.Type = &METADATA_SYM(EMPTY_TUPLE_MANGLING);
205203
}
206204

207205
return AnyReturn(outValue);

0 commit comments

Comments
 (0)