diff --git a/rtc_tools/rtc_event_log_visualizer/analyzer.cc b/rtc_tools/rtc_event_log_visualizer/analyzer.cc index d481f3ab02..d9df39c5d4 100644 --- a/rtc_tools/rtc_event_log_visualizer/analyzer.cc +++ b/rtc_tools/rtc_event_log_visualizer/analyzer.cc @@ -697,10 +697,13 @@ void EventLogAnalyzer::InitializeMapOfNamedGraphs(bool show_detector_state, void EventLogAnalyzer::CreateGraphsByName(const std::vector& names, PlotCollection* collection) { - for (const auto& plot : plots_) { - if (absl::c_find(names, plot.label) != names.end()) { - Plot* output = collection->AppendNewPlot(plot.label); - plot.plot_func(output); + for (absl::string_view name : names) { + auto plot = absl::c_find_if(plots_, [name](const PlotDeclaration& plot) { + return plot.label == name; + }); + if (plot != plots_.end()) { + Plot* output = collection->AppendNewPlot(plot->label); + plot->plot_func(output); } } } diff --git a/rtc_tools/rtc_event_log_visualizer/analyzer_bindings.cc b/rtc_tools/rtc_event_log_visualizer/analyzer_bindings.cc index 0766615908..35a6375001 100644 --- a/rtc_tools/rtc_event_log_visualizer/analyzer_bindings.cc +++ b/rtc_tools/rtc_event_log_visualizer/analyzer_bindings.cc @@ -32,8 +32,6 @@ #include "rtc_tools/rtc_event_log_visualizer/proto/chart.pb.h" #endif -using webrtc::PacketDirection; - namespace { std::vector StrSplit(const std::string& s, const std::string& delimiter) { diff --git a/rtc_tools/rtc_event_log_visualizer/main.cc b/rtc_tools/rtc_event_log_visualizer/main.cc index 5ddaff8c02..78c09d3445 100644 --- a/rtc_tools/rtc_event_log_visualizer/main.cc +++ b/rtc_tools/rtc_event_log_visualizer/main.cc @@ -117,8 +117,6 @@ ABSL_FLAG(bool, false, "List of registered plots (for use with the --plot flag)"); -using webrtc::Plot; - namespace { std::vector StrSplit(const std::string& s, const std::string& delimiter) {