This is a bit strange.
inline unsigned int SearchTreeNode::GetDeepestMatchingPosition(BasicSearchTree* tree, const wxString& s,unsigned int StringStartDepth)
I carefully examined the code, I found that the above function will always be called with the parameter StringStartDepth==0.
The only existence of this call is in FindNode().
bool BasicSearchTree::FindNode(const wxString& s, nSearchTreeNode nparent, SearchTreePoint* result)
{
size_t top_depth = m_pNodes[nparent]->GetDepth();
......
unsigned int newdepth = childnode->GetDeepestMatchingPosition(this,s,top_depth);
......
}
But all the FindNode() function was used like below( the second parameter is always 0 )
FindNode(s, 0, &resultpos)
So, the root node's parent is itself. and its depth is surely zero.
Any comments? Thanks.