Просмотр исходного кода

lsof: Replace copy with reference in a for loop

Linus Groh 4 лет назад
Родитель
Сommit
1f62aaa193
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Userland/Utilities/lsof.cpp

+ 1 - 1
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; }));
         }
     }