emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: noverlay branch


From: Stefan Monnier
Subject: Re: noverlay branch
Date: Wed, 12 Oct 2022 14:02:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> --- a/src/itree.c
> +++ b/src/itree.c
> @@ -307,6 +307,7 @@ check_tree (struct interval_tree *tree,
>    if (tree->root == ITREE_NULL)
>      return true;
>    eassert (tree->root->parent == ITREE_NULL);
> +  eassert (!check_red_black_invariants || !tree->root->red);
>  
>    struct interval_node *node = tree->root;
>    struct check_subtree_result result

Does any part of the code care about that?  I can't see anything that
would break if this invariant is not satisfied (both in terms of
correct behavior and in terms of performance).  IOW it seems more like
an accident than something important would should check.

>      {
>        eassert (left_result.black_height == right_result.black_height);
> -      eassert (node->parent != ITREE_NULL || !node->red || 
> !node->parent->red);
> +      eassert (node->parent == ITREE_NULL || !node->red
> +               || !node->parent->red);
>      }

Duh!  Thanks,


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]