sipa / minisketch

Minisketch: an optimized library for BCH-based set reconciliation
MIT License
310 stars 52 forks source link

header: Delete default Minisketch constructor #89

Open TheCharlatan opened 5 months ago

TheCharlatan commented 5 months ago

I might be missing a reason for having the default constructor, but it is not used anywhere and trying to use one of its methods will cause a segfault.

theuni commented 5 months ago

Concept ACK. @TheCharlatan and I discussed this and couldn't find a user of the default ctor.

Barely any functions check for a valid m_minisketch before using it. So rather than adding the checks, we figured it made sense to just eliminate the possibility.

As far as I can see, without this ctor, the only way to hit a null m_minisketch would be a moved-from object, which is usually assumed to be undefined unless otherwise specified.