This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
The following commit(s) were added to refs/heads/main by this push:
new bf8438f chore(theta): flatten preamble_longs branches for clippy
(#104)
bf8438f is described below
commit bf8438f691b10e99fee3a121318efb5f61bcea45
Author: Xuanwo <[email protected]>
AuthorDate: Mon Mar 2 20:29:03 2026 +0800
chore(theta): flatten preamble_longs branches for clippy (#104)
---
datasketches/src/theta/sketch.rs | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/datasketches/src/theta/sketch.rs b/datasketches/src/theta/sketch.rs
index 1e8cbb4..f51c586 100644
--- a/datasketches/src/theta/sketch.rs
+++ b/datasketches/src/theta/sketch.rs
@@ -400,16 +400,12 @@ impl CompactThetaSketch {
fn preamble_longs(&self, compressed: bool) -> u8 {
if compressed {
if self.is_estimation_mode() { 2 } else { 1 }
+ } else if self.is_estimation_mode() {
+ 3
+ } else if self.is_empty() || self.entries.len() == 1 {
+ 1
} else {
- if self.is_estimation_mode() {
- 3
- } else {
- if self.is_empty() || self.entries.len() == 1 {
- 1
- } else {
- 2
- }
- }
+ 2
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]