From: Soeren Apel Date: Sun, 8 Mar 2020 09:39:06 +0000 (+0100) Subject: TraceView: Don't use unordered sets and maps X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9cee9c1b895be4010deb55623f5c6916320d4401;p=pulseview.git TraceView: Don't use unordered sets and maps --- diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 69599b1b..93bcb520 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -82,8 +81,6 @@ using std::pair; using std::set; using std::set_difference; using std::shared_ptr; -using std::unordered_map; -using std::unordered_set; using std::vector; namespace pv { @@ -1375,12 +1372,11 @@ void View::update_layout() TraceTreeItemOwner* View::find_prevalent_trace_group( const shared_ptr &group, - const unordered_map, shared_ptr > - &signal_map) + const map, shared_ptr > &signal_map) { assert(group); - unordered_set owners; + set owners; vector owner_list; // Make a set and a list of all the owners @@ -1412,8 +1408,7 @@ TraceTreeItemOwner* View::find_prevalent_trace_group( vector< shared_ptr > View::extract_new_traces_for_channels( const vector< shared_ptr > &channels, - const unordered_map, shared_ptr > - &signal_map, + const map, shared_ptr > &signal_map, set< shared_ptr > &add_list) { vector< shared_ptr > filtered_traces; @@ -1754,8 +1749,7 @@ void View::signals_changed() inserter(remove_traces, remove_traces.begin())); // Make a look-up table of sigrok Channels to pulseview Signals - unordered_map, shared_ptr > - signal_map; + map, shared_ptr > signal_map; for (const shared_ptr& sig : signals_) signal_map[sig->base()] = sig; @@ -1856,7 +1850,7 @@ void View::signals_changed() // Add and position the pending top levels items int offset = v_extents().second; - for (auto item : new_top_level_items) { + for (shared_ptr item : new_top_level_items) { add_child_item(item); // Position the item after the last item or at the top if there is none diff --git a/pv/views/trace/view.hpp b/pv/views/trace/view.hpp index 5863bc9d..8183fefc 100644 --- a/pv/views/trace/view.hpp +++ b/pv/views/trace/view.hpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -43,7 +42,7 @@ #include "tracetreeitemowner.hpp" using std::list; -using std::unordered_map; +using std::map; using std::set; using std::shared_ptr; using std::vector; @@ -404,14 +403,12 @@ private: TraceTreeItemOwner* find_prevalent_trace_group( const shared_ptr &group, - const unordered_map, - shared_ptr > &signal_map); + const map, shared_ptr > &signal_map); static vector< shared_ptr > extract_new_traces_for_channels( const vector< shared_ptr > &channels, - const unordered_map, - shared_ptr > &signal_map, + const map, shared_ptr > &signal_map, set< shared_ptr > &add_list); void determine_time_unit();