summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tree.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/tree.c b/src/tree.c
index fc82cf6..7479e80 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -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