comparison dep/animia/src/strategist.cc @ 150:ffa535b6d630

*: avoid usage of std::[pair,tuple] https://arne-mertz.de/2017/03/smelly-pair-tuple/ it's better to use real structures and such where variables are easily known... also apparently using [] on structs is actually valid? I had no idea.
author Paper <mrpapersonic@gmail.com>
date Tue, 14 Nov 2023 16:27:33 -0500
parents aa4df5a84338
children 54744a48a7d7
comparison
equal deleted inserted replaced
149:e41505d24733 150:ffa535b6d630
48 48
49 bool Strategist::ApplyOpenFilesStrategy() { 49 bool Strategist::ApplyOpenFilesStrategy() {
50 bool success = false; 50 bool success = false;
51 51
52 const std::set<pid_t> pids{result_.process.pid}; 52 const std::set<pid_t> pids{result_.process.pid};
53 std::vector<std::pair<pid_t, std::string>> files; 53 std::vector<OpenFile> files;
54 54
55 fd.EnumerateOpenFiles(pids, files); 55 fd.EnumerateOpenFiles(pids, files);
56 56
57 for (const auto& [pid, file] : files) { 57 for (const auto& file : files) {
58 success |= AddMedia({MediaInfoType::File, file}); 58 success |= AddMedia({MediaInfoType::File, file.path});
59 } 59 }
60 60
61 return success; 61 return success;
62 } 62 }
63 63