Drop intermediate list of files from log reading
We are saving a temporary variable in a ton of places for the lifetime
of the program. Inline it so we can change the return type.
Change-Id: If8d90ffd07806644aceed4c44087e5fd206c8df9
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/y2022/vision/viewer_replay.cc b/y2022/vision/viewer_replay.cc
index 66087e5..7e8c800 100644
--- a/y2022/vision/viewer_replay.cc
+++ b/y2022/vision/viewer_replay.cc
@@ -47,10 +47,9 @@
data->match_start = monotonic_clock::min_time;
data->match_end = monotonic_clock::min_time;
- std::vector<std::string> unsorted_logfiles =
- aos::logger::FindLogs(FLAGS_roborio_log);
// Open logfiles
- aos::logger::LogReader reader(aos::logger::SortParts(unsorted_logfiles));
+ aos::logger::LogReader reader(
+ aos::logger::SortParts(aos::logger::FindLogs(FLAGS_roborio_log)));
reader.Register();
const aos::Node *roborio =
aos::configuration::GetNode(reader.configuration(), "roborio");
@@ -149,11 +148,9 @@
<< "Can't use match timestamps if match never ended";
}
- std::vector<std::string> unsorted_logfiles =
- aos::logger::FindLogs(FLAGS_logger_pi_log);
-
// Open logfiles
- aos::logger::LogReader reader(aos::logger::SortParts(unsorted_logfiles));
+ aos::logger::LogReader reader(
+ aos::logger::SortParts(aos::logger::FindLogs(FLAGS_logger_pi_log)));
reader.Register();
const aos::Node *pi =
aos::configuration::GetNode(reader.configuration(), FLAGS_pi);