tisonkun commented on code in PR #1:
URL: https://github.com/apache/datasketches-rust/pull/1#discussion_r2617227689
##########
src/hll/aux_map.rs:
##########
@@ -105,7 +105,9 @@ impl AuxMap {
let index = self.find(slot);
match index {
FindResult::Found(_) => {
- panic!("slot {} already exists in aux map", slot);
+ // Invariant: Array4 always check existance before inserting
+ // a new value on the same slot.
+ unreachable!("slot {} already exists in aux map", slot);
Review Comment:
In the other direction, if `AuxMap` is open to be used by other struct
later, we can keep the `Panics` section but instead document in the caller side
how the SAFETY condition is held.
Or even make this method fallible - but this can go in a bikeshedding
overengineering direction since I can't define a proper fallible interface
immediately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]