Skip to content

Commit

Permalink
typo in assert for flatten; checking the wrong symbol was current [st…
Browse files Browse the repository at this point in the history
…ate.min is actually the previous symbol].
  • Loading branch information
ixchow committed Oct 28, 2023
1 parent ff61f3a commit 27bbe18
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ak-link_chains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,12 @@ void flatten(std::vector< uint32_t > &closest, std::vector< float > const &weigh
}
assert(!symbols.empty());


//DEBUG:
//std::cout << "condensed:";
//for (auto const &s : symbols) std::cout << ' ' << s.first;
//std::cout << std::endl;

//(b) early-out in certain easy-to-check conditions:
if (symbols.size() == 1) return; //single symbol
//DEBUG: don't do these checks; exercise the code a bit more instead:
Expand Down Expand Up @@ -1864,7 +1870,7 @@ void flatten(std::vector< uint32_t > &closest, std::vector< float > const &weigh
if (state.min != next.min && state.max != next.max) {
//a(bc)d -> (abcd), keep 'a' (next.min), 'd' (state.max)
assert(bit_symbols[next.min].first == bit_symbols[state.max].first);
assert(next.current == bit_symbols[state.min].first);
assert(next.current == bit_symbols[next.min].first);
//std::cout << "keep " << int32_t(next.min) << " (\"" << symbols[next.min].first << "\")" << ", " << int32_t(state.max) << " (\"" << symbols[state.max].first << "\")" << std::endl; //DEBUG
assert(keep[next.min] == -1);
assert(keep[state.max] == -1);
Expand Down

0 comments on commit 27bbe18

Please sign in to comment.