Skip to content

Commit d0afcf0

Browse files
Fix inconsistency
1 parent bf8438f commit d0afcf0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

datasketches/src/cpc/sketch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl CpcSketch {
9797
///
9898
/// # Panics
9999
///
100-
/// Panics if `lg_k` is not in the range `[4, 16]`.
100+
/// Panics if `lg_k` is not in the range `[4, 26]`.
101101
pub fn new(lg_k: u8) -> Self {
102102
Self::with_seed(lg_k, DEFAULT_UPDATE_SEED)
103103
}
@@ -106,7 +106,7 @@ impl CpcSketch {
106106
///
107107
/// # Panics
108108
///
109-
/// Panics if `lg_k` is not in the range `[4, 16]`, or the computed seed hash is zero.
109+
/// Panics if `lg_k` is not in the range `[4, 26]`, or the computed seed hash is zero.
110110
pub fn with_seed(lg_k: u8, seed: u64) -> Self {
111111
assert!(
112112
(MIN_LG_K..=MAX_LG_K).contains(&lg_k),

datasketches/src/cpc/union.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl CpcUnion {
9191
///
9292
/// # Panics
9393
///
94-
/// Panics if `lg_k` is not in the range `[4, 16]`.
94+
/// Panics if `lg_k` is not in the range `[4, 26]`.
9595
pub fn new(lg_k: u8) -> Self {
9696
Self::with_seed(lg_k, DEFAULT_UPDATE_SEED)
9797
}
@@ -100,7 +100,7 @@ impl CpcUnion {
100100
///
101101
/// # Panics
102102
///
103-
/// Panics if `lg_k` is not in the range `[4, 16]`.
103+
/// Panics if `lg_k` is not in the range `[4, 26]`.
104104
pub fn with_seed(lg_k: u8, seed: u64) -> Self {
105105
// We begin with the accumulator holding an EMPTY_MERGED sketch object.
106106
let sketch = CpcSketch::with_seed(lg_k, seed);

datasketches/src/theta/bit_pack.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4974,15 +4974,15 @@ fn unpack_bits_63(values: &mut [u64], bytes: &[u8]) {
49744974
///
49754975
/// * Panics if `values.len()` is not equal to `BLOCK_WIDTH`.
49764976
/// * Panics if `bits` is not in the range `1..=63`.
4977-
/// * Panics if `bytes.len()` is less than `bits * BLOCK_WIDTH`.
4977+
/// * Panics if `bytes.len()` is less than `bits`.
49784978
pub(crate) fn pack_bits_block(values: &[u64], bytes: &mut [u8], bits: u8) {
49794979
assert_eq!(values.len(), BLOCK_WIDTH, "values length must be 8");
49804980
assert!(
49814981
(1..=63).contains(&bits),
49824982
"wrong number of bits in pack_bits_block8: {bits}"
49834983
);
49844984
assert!(
4985-
bytes.len() < bits as usize * BLOCK_WIDTH,
4985+
bytes.len() >= bits as usize,
49864986
"output buffer too small"
49874987
);
49884988

@@ -5060,15 +5060,15 @@ pub(crate) fn pack_bits_block(values: &[u64], bytes: &mut [u8], bits: u8) {
50605060
///
50615061
/// * Panics if `values.len()` is not equal to `BLOCK_WIDTH`.
50625062
/// * Panics if `bits` is not in the range `1..=63`.
5063-
/// * Panics if `bytes.len()` is less than `bits * BLOCK_WIDTH`.
5063+
/// * Panics if `bytes.len()` is less than `bits`.
50645064
pub(crate) fn unpack_bits_block(values: &mut [u64], bytes: &[u8], bits: u8) {
50655065
assert_eq!(values.len(), BLOCK_WIDTH, "values length must be 8");
50665066
assert!(
50675067
(1..=63).contains(&bits),
50685068
"wrong number of bits in unpack_bits_block8: {bits}"
50695069
);
50705070
assert!(
5071-
bytes.len() < bits as usize * BLOCK_WIDTH,
5071+
bytes.len() >= bits as usize,
50725072
"input buffer too small"
50735073
);
50745074

0 commit comments

Comments
 (0)