From 1f62aaa19343b2b1c93067fbfdb89913ad11e2f7 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 31 May 2021 18:03:54 +0100 Subject: [PATCH] lsof: Replace copy with reference in a for loop --- Userland/Utilities/lsof.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Utilities/lsof.cpp b/Userland/Utilities/lsof.cpp index b639410f19..330d6363ba 100644 --- a/Userland/Utilities/lsof.cpp +++ b/Userland/Utilities/lsof.cpp @@ -174,7 +174,7 @@ int main(int argc, char* argv[]) if (open_files.is_empty()) return 0; - for (auto file : open_files) { + for (auto& file : open_files) { display_entry(file, *processes->find_if([&](auto& entry) { return entry.pid == arg_pid; })); } }