diff --git a/include/seqan3/contrib/sdsl-lite.hpp b/include/seqan3/contrib/sdsl-lite.hpp index f592c91fc4..3730873999 100644 --- a/include/seqan3/contrib/sdsl-lite.hpp +++ b/include/seqan3/contrib/sdsl-lite.hpp @@ -27342,12 +27342,12 @@ class wt_epr { if (0 == m_size) return; - std::vector C; - calculate_character_occurences(begin, end, C); - calculate_effective_alphabet_size(C, m_sigma); - if (m_sigma > alphabet_size) + if (std::any_of(begin, end, [](size_t value) { return value >= alphabet_size; })) + { throw std::domain_error{"The given text uses an alphabet that is larger than the explicitly given " "alphabet size."}; + } + m_sigma = alphabet_size; int_vector<> intermediate_bitvector{}; intermediate_bitvector.width(std::ceil(std::log2(m_sigma))); intermediate_bitvector.resize(m_size);