src/c++/lib/common/ReadPileup.cpp
/**
 * Clear out reads that end before pos
 */
Clear out reads that end before pos
Clear out reads that end before pos
void ReadPileup::flush(int64_t pos)
{
    size_t deleted = 0;
    while (!_impl->read_list.empty() && _impl->read_list.front()->end() < pos)
    {
        _impl->read_list.pop_front();
        ++deleted;
    }
    if (deleted > 0)
    {
        _impl->reads.resize(_impl->read_list.size());
        size_t index = 0;
        for (auto& read : _impl->read_list)
        {
            _impl->reads[index++] = read.get();
        }
    }
}
void ReadPileup :: flush ( int64_t pos ) { size_t deleted = 0 ; while ( ! _impl -> read_list . empty ( ) && _impl -> read_list . front ( ) -> end ( ) < pos ) { _impl -> read_list . pop_front ( ) ; ++ deleted ; } if ( deleted > 0 ) { _impl -> reads . resize ( _impl -> read_list . size ( ) ) ; size_t index = 0 ; for ( auto & read : _impl -> read_list ) { _impl -> reads [ index ++ ] = read . get ( ) ; } } }
Clear out reads that end before pos
Clear out reads that end before pos