This is an automated email from the ASF dual-hosted git repository.

tisonkun pushed a commit to branch codex/naming-drift-audit
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git

commit b8d72425c81be1a5999294132b54fd5e92737aa0
Author: tison <[email protected]>
AuthorDate: Sat Jul 25 21:43:30 2026 +0800

    refactor(cpc): follow mutable accessor naming convention
---
 datasketches/src/cpc/sketch.rs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/datasketches/src/cpc/sketch.rs b/datasketches/src/cpc/sketch.rs
index 4bf9e00..9b61fa9 100644
--- a/datasketches/src/cpc/sketch.rs
+++ b/datasketches/src/cpc/sketch.rs
@@ -241,7 +241,7 @@ impl CpcSketch {
             .expect("surprising value table must be initialized")
     }
 
-    pub(super) fn mut_surprising_value_table(&mut self) -> &mut PairTable {
+    pub(super) fn surprising_value_table_mut(&mut self) -> &mut PairTable {
         self.surprising_value_table
             .as_mut()
             .expect("surprising value table must be initialized")
@@ -259,7 +259,7 @@ impl CpcSketch {
         let k = 1 << self.lg_k;
         let c32pre = (self.num_coupons as u64) << 5;
         debug_assert!(c32pre < 3 * k); // C < 3K/32, in other words, flavor == 
SPARSE
-        let is_novel = self.mut_surprising_value_table().maybe_insert(row_col);
+        let is_novel = self.surprising_value_table_mut().maybe_insert(row_col);
         if is_novel {
             self.num_coupons += 1;
             self.update_hip(row_col);
@@ -292,7 +292,7 @@ impl CpcSketch {
                     self.sliding_window[row] |= 1 << col;
                 } else {
                     // cannot use must_insert(), because it doesn't provide 
for growth
-                    let is_novel = 
self.mut_surprising_value_table().maybe_insert(row_col);
+                    let is_novel = 
self.surprising_value_table_mut().maybe_insert(row_col);
                     debug_assert!(is_novel);
                 }
             }
@@ -312,7 +312,7 @@ impl CpcSketch {
         let col = (row_col & 63) as u8;
         if col < self.window_offset {
             // track the surprising 0's "before" the window
-            is_novel = 
self.mut_surprising_value_table().maybe_delete(row_col); // inverted logic
+            is_novel = 
self.surprising_value_table_mut().maybe_delete(row_col); // inverted logic
         } else if col < self.window_offset + 8 {
             // track the 8 bits inside the window
             let row = (row_col >> 6) as usize;
@@ -324,7 +324,7 @@ impl CpcSketch {
             }
         } else {
             // track the surprising 1's "after" the window
-            is_novel = 
self.mut_surprising_value_table().maybe_insert(row_col); // normal logic
+            is_novel = 
self.surprising_value_table_mut().maybe_insert(row_col); // normal logic
         }
 
         if is_novel {
@@ -358,7 +358,7 @@ impl CpcSketch {
             self.refresh_kxp(&bit_matrix);
         }
 
-        self.mut_surprising_value_table().clear(); // the new number of 
surprises will be about the same
+        self.surprising_value_table_mut().clear(); // the new number of 
surprises will be about the same
 
         let mask_for_clearing_window = (0xFF << new_offset) ^ u64::MAX;
         let mask_for_flipping_early_zone = (1u64 << new_offset) - 1;
@@ -376,7 +376,7 @@ impl CpcSketch {
                 let col = pattern.trailing_zeros();
                 pattern ^= 1 << col; // erase the 1
                 let row_col = ((i as u32) << 6) | col;
-                let is_novel = 
self.mut_surprising_value_table().maybe_insert(row_col);
+                let is_novel = 
self.surprising_value_table_mut().maybe_insert(row_col);
                 debug_assert!(is_novel);
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to