示例#1
0
文件: Tree.cs 项目: otodo/Diffbycs
 public TreeItem( Tree rootParam, ulong keyParam, object value )
 {
     root = rootParam;
     key  = keyParam;
     left  = null;
     right = null;
     data  = value;
     refCount = 0;
 }
示例#2
0
文件: Section.cs 项目: otodo/Diffbycs
        /***************************************************************************
         * Function: MakeCTree
         * Purpose:
         * Build a ctree from the lines in the section given
         * Remember that we are only interested in the lines that are
         * not already linked.
         * The value we store in the tree is the handle of the line. the key
         * is the line hash code  */
        public Tree MakeCTree(bool isIgnoreBlanks)
        {
            Tree tree = new Tree();	/* make an empty tree */

            for( Line line = first; line != null; line = (Line)line.GetNext() ) {
                if( line.link == null) {
                    tree.update( line.GetHashcode(isIgnoreBlanks), line );
                }
                if( line == last ) break;
            }
            return tree;
        }