示例#1
0
        public bool FindPreviousKey(List <NodeIdxPair> stack)
        {
            int idx = stack.Count - 1;

            while (idx >= 0)
            {
                var pair = stack[idx];
                if (pair.Idx > 0)
                {
                    stack.RemoveRange(idx + 1, stack.Count - idx - 1);
                    stack[idx] = new NodeIdxPair {
                        Node = pair.Node, Idx = pair.Idx - 1
                    };
                    pair.Node.FillStackByRightMost(stack, pair.Idx - 1);
                    return(true);
                }
                idx--;
            }
            return(false);
        }
示例#2
0
文件: BTreeRoot.cs 项目: Bobris/BTDB
 public bool FindPreviousKey(List<NodeIdxPair> stack)
 {
     int idx = stack.Count - 1;
     while (idx >= 0)
     {
         var pair = stack[idx];
         if (pair.Idx > 0)
         {
             stack.RemoveRange(idx + 1, stack.Count - idx - 1);
             stack[idx] = new NodeIdxPair { Node = pair.Node, Idx = pair.Idx - 1 };
             pair.Node.FillStackByRightMost(stack, pair.Idx - 1);
             return true;
         }
         idx--;
     }
     return false;
 }
示例#3
0
文件: BTreeRoot.cs 项目: Bobris/BTDB
 public bool FindNextKey(List<NodeIdxPair> stack)
 {
     int idx = stack.Count - 1;
     while (idx >= 0)
     {
         var pair = stack[idx];
         if (pair.Node.NextIdxValid(pair.Idx))
         {
             stack.RemoveRange(idx + 1, stack.Count - idx - 1);
             stack[idx] = new NodeIdxPair { Node = pair.Node, Idx = pair.Idx + 1 };
             pair.Node.FillStackByLeftMost(stack, pair.Idx + 1);
             return true;
         }
         idx--;
     }
     return false;
 }