X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Flogicsegment.cpp;h=6350682f95ac2a5ae69e8c11e482fc6212914a67;hp=bdfc98167b81df85132c2ce2c5310bbe4b62fc52;hb=6f925ba9d6faf1077b73c5a5808259576081716a;hpb=1f1d55ce48ae1dac0f077c60827a41b368b5207a diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index bdfc981..6350682 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -35,6 +35,7 @@ using std::max; using std::min; using std::pair; using std::shared_ptr; +using std::vector; using sigrok::Logic; @@ -298,7 +299,7 @@ uint64_t LogicSegment::get_unpacked_sample(uint64_t index) const } void LogicSegment::get_subsampled_edges( - std::vector &edges, + vector &edges, uint64_t start, uint64_t end, float min_length, int sig_index) { @@ -322,7 +323,7 @@ void LogicSegment::get_subsampled_edges( // Store the initial state last_sample = (get_unpacked_sample(start) & sig_mask) != 0; - edges.push_back(pair(index++, last_sample)); + edges.emplace_back(index++, last_sample); while (index + block_length <= end) { //----- Continue to search -----// @@ -458,7 +459,7 @@ void LogicSegment::get_subsampled_edges( // Store the final state const bool final_sample = (get_unpacked_sample(final_index - 1) & sig_mask) != 0; - edges.push_back(pair(index, final_sample)); + edges.emplace_back(index, final_sample); index = final_index; last_sample = final_sample; @@ -467,8 +468,8 @@ void LogicSegment::get_subsampled_edges( // Add the final state const bool end_sample = get_unpacked_sample(end) & sig_mask; if (last_sample != end_sample) - edges.push_back(pair(end, end_sample)); - edges.push_back(pair(end + 1, end_sample)); + edges.emplace_back(end, end_sample); + edges.emplace_back(end + 1, end_sample); } uint64_t LogicSegment::get_subsample(int level, uint64_t offset) const