Re: algorithm clean-up

On Jul 2, 2014, at 16:40, Jim Barnett <> wrote:

> I've been looking at the algorithm and wonder about the use of OrderedSet. I don't think that we rely on the ordering anywhere, and in any case the implied ordering is hard to understand.  The set is ordered by the order in which elements are added to it, so you have to thread through the whole algorithm to figure out the ordering. It might be simpler to:
> 1.  Replace OrderedSet with Set (i.e. unordered)
> 2.  Add an explicit sort every place the ordering matters.

We are using a NodeSet anyway and call to_document_order() as needed, so we basically already do what you propose and support this.

> Any opinions on this?  Since the algorithm is now only informative, we can feel freer to change it, since we don't have to go back to Last Call every time we modify it.
> -- 
> Jim Barnett
> Genesys
> P.S.  The real simplification would be to get rid of Set and use List everywhere, but I don't think we can.  For example, SelectTransitions can add the same transition multiple times (if multiple descendant states select the same transition in an ancestor state).  By putting the selected transitions in a Set, we don't have to add a bunch of fussy code removing duplicates.

Received on Wednesday, 2 July 2014 17:47:52 UTC