3 ms·
Granted I haven't tried to get it through review, but for things where the fast version is complicated I usually end up with static bool set_t_contains_fas
by JonChesterfield 4y ago
Granted I haven't tried to get it through review, but for things where the fast version is complicated I usually end up with
static bool set_t_contains_fast(set_t x, uint64_t e);
static bool set_t_contains_simple(set_t x, uint64_t e);
bool set_t_contains(set_t x, uint64_t e)
{
bool f = set_t_contains_fast(x, e);
assert(set_t_contains_simple(x, e) == f);
return f;
}
sometimes with a CONTRACTS macro controlling it instead of an assert.