lib/src/diet.c
struct ival * diet_find(struct diet * const d, const uint64_t n)
{
    if (splay_empty(d))
        return 0;
    diet_splay(d, &(const struct ival){.lo = n, .hi = n});
    if (n < splay_root(d)->lo || n > splay_root(d)->hi)
        return 0;
    return splay_root(d);
}
/// Pointer to the interval containing @p n in diet tree @p t. Also has the side
/// effect of splaying the closest interval to @p n to the root of @p t.
///
/// @param      d     Diet tree.
/// @param[in]  n     Integer.
///
/// @return     Pointer to the ival structure containing @p i; zero otherwise.
///
Pointer to the interval containing @p n in diet tree @p t. Also has the side
effect of splaying the closest interval to @p n to the root of @p t.
Pointer to the interval containing @p n in diet tree @p t . Also has the side effect of splaying the closest interval to @p n to the root of @p t .
struct ival * diet_find(struct diet * const d, const uint64_t n)
{
    if (splay_empty(d))
        return 0;
    diet_splay(d, &(const struct ival){.lo = n, .hi = n});
    if (n < splay_root(d)->lo || n > splay_root(d)->hi)
        return 0;
    return splay_root(d);
}
struct ival * diet_find ( struct diet * const d , const uint64_t n ) { if ( splay_empty ( d ) ) return 0 ; diet_splay ( d , & ( const struct ival ) { . lo = n , . hi = n } ) ; if ( n < splay_root ( d ) -> lo || n > splay_root ( d ) -> hi ) return 0 ; return splay_root ( d ) ; }
Pointer to the interval containing @p n in diet tree @p t. Also has the side
effect of splaying the closest interval to @p n to the root of @p t.
Pointer to the interval containing @p n in diet tree @p t . Also has the side effect of splaying the closest interval to @p n to the root of @p t .