Skip to content

Commit

Permalink
fixed bit_vector_iterator::read_reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
jermp committed Sep 25, 2024
1 parent 9158671 commit 40e020c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions include/bit_vector_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ struct bit_vector_iterator {
if (m_avail < l) fill_buf_reverse();
kmer_t val = 0;
if (l != constants::uint_kmer_bits) {
uint64_t shift = (l >= 64) ? (constants::uint_kmer_bits - l) : 64;
val = m_buf >> shift;
val = m_buf >> (constants::uint_kmer_bits - l);
} else {
val = m_buf;
}
Expand Down Expand Up @@ -122,14 +121,14 @@ struct bit_vector_iterator {
} else {
assert(constants::uint_kmer_bits == 128);
if (m_pos < 128) {
m_buf = static_cast<kmer_t>(m_bv->get_word64(0)) << 64;
m_buf += static_cast<kmer_t>(m_bv->get_word64(64));
m_buf = static_cast<kmer_t>(m_bv->get_word64(64)) << 64;
m_buf += static_cast<kmer_t>(m_bv->get_word64(0));
m_avail = m_pos;
m_buf <<= (128 - m_pos);
return;
}
m_buf = static_cast<kmer_t>(m_bv->get_word64(m_pos - 128)) << 64;
m_buf += static_cast<kmer_t>(m_bv->get_word64(m_pos - 64));
m_buf = static_cast<kmer_t>(m_bv->get_word64(m_pos - 64)) << 64;
m_buf += static_cast<kmer_t>(m_bv->get_word64(m_pos - 128));
}
m_avail = constants::uint_kmer_bits;
}
Expand Down

0 comments on commit 40e020c

Please sign in to comment.