index: mmap: read child node

This commit is contained in:
Lucas De Marchi 2011-12-02 17:41:46 -02:00
parent 77bf936a89
commit 91298dc79e

View File

@ -706,3 +706,14 @@ static struct index_mm_node *index_mm_readroot(struct index_mm *idx)
{
return index_mm_read_node(idx, idx->root_offset);
}
static struct index_mm_node *index_mm_readchild(const struct index_mm_node *parent,
int ch)
{
if (parent->first <= ch && ch <= parent->last) {
return index_mm_read_node(parent->idx,
parent->children[ch - parent->first]);
}
return NULL;
}