Skip to content

Commit 4db46b0

Browse files
committed
[Serialization] Make the input/output of a helper lambda clearer
It still has side effects, and it's still a lambda rather than a helper function because it's not used anywhere else, but `[&]` captures in helper lambdas make me nervous (as opposed to callback lambdas).
1 parent fff69c9 commit 4db46b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4802,7 +4802,7 @@ class swift::TypeDeserializer {
48024802
decls_block::SILBoxTypeLayout::readRecord(scratch, layoutID, subMapID);
48034803

48044804
// Get the layout.
4805-
auto getLayout = [&]() -> SILLayout * {
4805+
auto getLayout = [this](SILLayoutID layoutID) -> SILLayout * {
48064806
assert(layoutID > 0 && layoutID <= MF.SILLayouts.size()
48074807
&& "invalid layout ID");
48084808

@@ -4822,7 +4822,7 @@ class swift::TypeDeserializer {
48224822
return layout;
48234823
};
48244824

4825-
auto layout = getLayout();
4825+
auto layout = getLayout(layoutID);
48264826
if (!layout)
48274827
return nullptr;
48284828

0 commit comments

Comments
 (0)