comparison dep/animone/src/strategist.cc @ 264:9a04802848c0

*: improve multiple things e.g. making some strings.cc functions modify strings in-place, improving m4_ax_have_qt.m4 code, making anime_db.cc rely on std::optional rather than std::shared_ptr (which was stupid anyway)
author Paper <paper@paper.us.eu.org>
date Thu, 11 Apr 2024 10:15:57 -0400
parents 862d0d8619f6
children 5437009cb10e
comparison
equal deleted inserted replaced
263:96416310ea14 264:9a04802848c0
72 static bool ApplyOpenFilesStrategy(std::vector<Result>& results) { 72 static bool ApplyOpenFilesStrategy(std::vector<Result>& results) {
73 bool success = false; 73 bool success = false;
74 74
75 /* map pids to our results, saves time with open_file_proc */ 75 /* map pids to our results, saves time with open_file_proc */
76 std::unordered_map<pid_t, Result*> pid_map; 76 std::unordered_map<pid_t, Result*> pid_map;
77 pid_map.reserve(results.size());
78
79 std::set<pid_t> pids; 77 std::set<pid_t> pids;
80 78
81 for (Result& result : results) { 79 for (Result& result : results) {
82 const pid_t pid = result.process.pid; 80 const pid_t pid = result.process.pid;
83 if (!pid) 81 if (!pid)