Prepend values to GtkTreeStore to eliminate quadratic complexity
commit44fec8f7518d63eeb4e1a784ec7fe465d0002270
authorJiří Techet <techet@gmail.com>
Sun, 3 May 2015 09:34:30 +0000 (3 11:34 +0200)
committerJiří Techet <techet@gmail.com>
Sun, 3 May 2015 17:36:26 +0000 (3 19:36 +0200)
treee8f0a98fbc5b311973482d7134856f178ad60a58
parent8ffd687af78f372da8063a4a480f4b0480613cc4
Prepend values to GtkTreeStore to eliminate quadratic complexity

The tree model nodes consist of GNode structs:

struct GNode {
  gpointer data;
  GNode   *next;
  GNode   *prev;
  GNode   *parent;
  GNode   *children;
};

where children are a linked list. To append a value, the list has to be
walked to the end and with nodes with many children (which is our case)
this becomes very expensive.

We sort the tree afterwards anyway so it doesn't matter where we insert the
value.
src/symbols.c