Skip to content

Commit 084c9cf

Browse files
committed
Updated Reader to use samples_view() method of SampleHeaders instance
This allows the names of only samples that have headers loaded to be iterated efficiently, both in terms of run-time and memory consumption.
1 parent a29e6b1 commit 084c9cf

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

libtiledbvcf/src/read/reader.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,9 +1204,7 @@ bool Reader::read_current_batch() {
12041204
// finalize the export
12051205
if (read_state_.query_contig_batch_idx ==
12061206
read_state_.query_regions_v4.size() - 1) {
1207-
// TODO: Replace with iterator of underlying map to avoid copy
1208-
for (const auto& s :
1209-
read_state_.current_hdrs.header_ordered_samples()) {
1207+
for (const auto& s : read_state_.current_hdrs.samples_view()) {
12101208
SafeBCFHdr hdr = read_state_.current_hdrs.get_sample_header(s);
12111209
exporter_->finalize_export(SampleAndId{s, 0}, hdr.get());
12121210
}

0 commit comments

Comments
 (0)