Re: EggSequence



+1 to seeing this in glib.

On Sun, 2007-01-28 at 01:50 +0100, Soeren Sandmann wrote:
> Hans Petter Jansson <hpj novell com> writes:
> Well, they are actually _more_ stable than other things we call
> iterators. GtkTree- and GtkTextIters become invalid as soon as you
> make _any_ change to the data structure. GSequenceIters only become
> invalid when you delete the item they point to. Also each GSequence
> has a special iterator, the 'end' iterator which does not point to any
> item in the sequence, but instead serves only as a marker. This is
> consistent with iterator semantics, rather than pointer semantics.

[ Minor nit: GtkTreeIter is stable when GTK_TREE_MODEL_ITERS_PERSIST is
set.  This dichotomy causes lots of uglyness, though. ]

> (In retrospect using a splaytree was probably not a wise decision. A
> red/black tree might have been better, even though it would have a
> code-complexity cost in some areas).

Yes.  We spent _years_ finding bugs in GtkRBTree.  I looked into putting
it into glib for a similar purpose, but didn't have the energy.  It
might be an interesting long-term project to move GtkTreeView over to it
at some point (assuming the aggregators in the header do what I think
they do.)

Thansk
-Jonathan




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