Skip to content

Commit

Permalink
nctree_add_internal: kill set-but-unused depth
Browse files Browse the repository at this point in the history
dankamongmen committed Jun 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a5d3a79 commit b43a905
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/lib/tree.c
Original file line number Diff line number Diff line change
@@ -165,15 +165,13 @@ static int
nctree_add_internal(nctree* n, nctree_int_item* nii, const unsigned* spec,
const struct nctree_item* add){
const unsigned* p = spec;
unsigned depth = 0;
while(p[1] != UINT_MAX){ // we know p[0] isn't UINT_MAX
if(*p >= nii->subcount){
logerror("invalid path element (%u >= %u)", *p, nii->subcount);
return -1;
}
nii = &nii->subs[*p];
++p;
++depth;
}
// we're at the node into which |add| ought be inserted
// this last one can be equal to subcount; we're placing it at the end

0 comments on commit b43a905

Please sign in to comment.