diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tree.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -122,13 +122,8 @@ mq_tree_remove(MqTree *node) } MqTree * -mq_tree_seek(MqTree *node, gint offset) +seek(MqTree *node, gint offset) { - /* XXX: Only forward seeking from a tree's root is supported. */ - g_assert(node); - g_assert(node->position == 0); - g_assert(offset > 0); - /* Skip forward to the containing subtree. */ while (node && node->position + node->size <= offset) { node = node->next; @@ -145,7 +140,18 @@ mq_tree_seek(MqTree *node, gint offset) } /* Recurse down the subtree. */ - return mq_tree_seek(node->first_child, offset); + return seek(node->first_child, offset); +} + +MqTree * +mq_tree_seek(MqTree *node, gint offset) +{ + /* XXX: Only forward seeking from a tree's root is supported. */ + g_assert(node); + g_assert(node->position == 0); + g_assert(offset > 0); + + return seek(node, offset); } static gboolean |