From 737c9f0a1441fd77f988b9f5e591e5a9bcb52e84 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 29 Aug 2020 14:07:21 +0200 Subject: [PATCH] Kernel: Explain correctness of reference to local lambda --- Kernel/FileSystem/Ext2FileSystem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp index 2d93e734fe..cbc9a93968 100644 --- a/Kernel/FileSystem/Ext2FileSystem.cpp +++ b/Kernel/FileSystem/Ext2FileSystem.cpp @@ -454,6 +454,8 @@ Vector Ext2FS::block_list_for_inode_impl(const ext2_inode& e if (!blocks_remaining) return list; + // Don't need to make copy of add_block, since this capture will only + // be called before block_list_for_inode_impl finishes. auto process_block_array = [&](unsigned array_block_index, auto&& callback) { if (include_block_list_blocks) add_block(array_block_index);