Re: [PATCH 1/4] revision: move bloom keyvec precondition into function

Jeff King <[email protected]> Wed, 5 Aug 2026 16:32:55 -0400
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Wed, Aug 05, 2026 at 09:16:00PM +0200, Toon Claes wrote:

> > But nobody ever cares about the difference between "1" and "-1", because
> > the probabilistic data structure means "we could not check" must err on
> > the side of "it might be in the filter".
> 
> That's not entirely true. The `count_bloom_filter_false_positive`
> depends on knowing whether the filter said "maybe" or if no filter was
> used at all.

Ah, yeah, you're right. I saw the "== 0" comparison there, but didn't
notice that we later checked it against "== 1".

> That said, the public function might have a boolean interface, while
> the private wrapper still uses the tristate. I'll address in the next
> version.

Yeah, I'd be OK with that. Or leaving it as-is, given that there is a
caller who cares. It might be less subtle if we used symbolic constants,
but that could be done separately (later or never if nobody cares
enough).

-Peff