Skip to content

Commit 06beb78

Browse files
Merge pull request #288 from apache/cpc_check_pseudo_phase
check pseudo phase
2 parents ce4d82c + 9769d25 commit 06beb78

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cpc/include/cpc_compressor_impl.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ void cpc_compressor<A>::compress_sliding_flavor(const cpc_sketch_alloc<A>& sourc
297297
// changes the implied ordering of the pairs, so we must do it before sorting.
298298

299299
const uint8_t pseudo_phase = determine_pseudo_phase(source.get_lg_k(), source.get_num_coupons());
300+
if (pseudo_phase >= 16) throw std::logic_error("unexpected pseudo phase for sliding flavor");
300301
const uint8_t* permutation = column_permutations_for_encoding[pseudo_phase];
301302

302303
const uint8_t offset = source.window_offset;
@@ -333,7 +334,7 @@ void cpc_compressor<A>::uncompress_sliding_flavor(const compressed_state<A>& sou
333334
lg_k, source.table_data.get_allocator());
334335

335336
const uint8_t pseudo_phase = determine_pseudo_phase(lg_k, num_coupons);
336-
if (pseudo_phase >= 16) throw std::logic_error("pseudo phase >= 16");
337+
if (pseudo_phase >= 16) throw std::logic_error("unexpected pseudo phase for sliding flavor");
337338
const uint8_t* permutation = column_permutations_for_decoding[pseudo_phase];
338339

339340
uint8_t offset = cpc_sketch_alloc<A>::determine_correct_offset(lg_k, num_coupons);

0 commit comments

Comments
 (0)