From: Joel Holdsworth Date: Fri, 16 Oct 2015 03:07:38 +0000 (-0600) Subject: TraceTreeItemOwner: Make list_by_type return a vector instead of a set X-Git-Tag: pulseview-0.3.0~94 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=364d2155b342d3ef8f5f2c22be54bb35d0882b76;p=pulseview.git TraceTreeItemOwner: Make list_by_type return a vector instead of a set --- diff --git a/pv/view/tracetreeitemowner.hpp b/pv/view/tracetreeitemowner.hpp index 4c0043f6..c1776995 100644 --- a/pv/view/tracetreeitemowner.hpp +++ b/pv/view/tracetreeitemowner.hpp @@ -128,12 +128,12 @@ public: * Creates a list of decendant signals filtered by type. */ template - std::set< std::shared_ptr > list_by_type() { - std::set< std::shared_ptr > items; + std::vector< std::shared_ptr > list_by_type() { + std::vector< std::shared_ptr > items; for (const auto &r : *this) { std::shared_ptr p = std::dynamic_pointer_cast(r); if (p) - items.insert(p); + items.push_back(p); } return items; diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 540b90e1..c0b3e251 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -875,7 +875,9 @@ void View::signals_changed() // Make a list of traces that are being added, and a list of traces // that are being removed - const set> prev_traces = list_by_type(); + const vector> prev_trace_list = list_by_type(); + const set> prev_traces( + prev_trace_list.begin(), prev_trace_list.end()); shared_lock lock(session_.signals_mutex()); const unordered_set< shared_ptr > &sigs(session_.signals());