Mercurial > libanimone
comparison src/strategist.cc @ 1:0c3cc9e6cd84
*: 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 | a76fa32bdc92 |
| children | 87841727fa47 |
comparison
equal
deleted
inserted
replaced
| 0:a76fa32bdc92 | 1:0c3cc9e6cd84 |
|---|---|
| 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) |
