X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fdecode%2Frowdata.cpp;fp=pv%2Fdata%2Fdecode%2Frowdata.cpp;h=7b6ec2d3f8b71bb0728cd1381a2867bb072f55c5;hb=462941e2626cef9855e810abdb0458e99ee1c5f1;hp=80d56aabb41c8fda4da8a89fc795241638ba4563;hpb=ef8d23e798d2b4799c4bcd13a85a1d4b7d1d897b;p=pulseview.git diff --git a/pv/data/decode/rowdata.cpp b/pv/data/decode/rowdata.cpp index 80d56aab..7b6ec2d3 100644 --- a/pv/data/decode/rowdata.cpp +++ b/pv/data/decode/rowdata.cpp @@ -49,7 +49,7 @@ uint64_t RowData::get_annotation_count() const } void RowData::get_annotation_subset( - vector &dest, + deque &dest, uint64_t start_sample, uint64_t end_sample) const { // Determine whether we must apply per-class filtering or not @@ -68,7 +68,6 @@ void RowData::get_annotation_subset( if (all_ann_classes_enabled) { // No filtering, send everyting out as-is - dest.reserve(dest.size() + annotations_.size()); for (const auto& annotation : annotations_) if ((annotation.end_sample() > start_sample) && (annotation.start_sample() <= end_sample)) @@ -82,9 +81,8 @@ void RowData::get_annotation_subset( if (c->visible) class_visible[c->id] = 1; - dest.reserve(dest.size() + annotations_.size()); for (const auto& annotation : annotations_) - if ((class_visible[annotation.ann_class()]) && + if ((class_visible[annotation.ann_class_id()]) && (annotation.end_sample() > start_sample) && (annotation.start_sample() <= end_sample)) dest.push_back(&annotation); @@ -110,7 +108,7 @@ void RowData::emplace_annotation(srd_proto_data *pdata) if (it != annotations_.begin()) it++; - annotations_.insert(it, Annotation(pdata, row_)); + annotations_.emplace(it, pdata, row_); } else { annotations_.emplace_back(pdata, row_); prev_ann_start_sample_ = pdata->start_sample;