public ByteStringToPtrByteTreeNode(ByteStringToPtrByteTreeNode *root = null) { _next = null; _value = null; _b = 0; _count = 0; }
public Byte *Get(byte *words, int length, ByteStringToPtrByteTreeNode *first) { ByteStringToPtrByteTreeNode *cur = first; while (length > 0) { cur = &(cur->_next)[*words]; words++; length--; } return(cur->_value); }
public void Add(byte *words, int length, byte *value, ByteStringToPtrByteTreeNode *first) { ByteStringToPtrByteTreeNode *cur = first; while (length > 0) { if (cur->_next == null) { cur->_next = (ByteStringToPtrByteTreeNode *)MemoryAllocator.New(sizeof(ByteStringToPtrByteTreeNode) * 256); MemoryHelper.Fill((byte *)cur->_next, 0x00, sizeof(ByteStringToPtrByteTreeNode) * 256); } cur = &(cur->_next)[*words]; words++; length--; } cur->_value = value; }
public bool AddBis(byte *words, int length, byte *value) { _b = *words; if (length == 0) { _value = value; return(true); } else { if (_next == null) { _next = (ByteStringToPtrByteTreeNode *)MemoryAllocator.New(sizeof(ByteStringToPtrByteTreeNode) * 256); MemoryHelper.Fill((byte *)_next, 0x00, sizeof(ByteStringToPtrByteTreeNode) * 256); } if (_next[*words].AddBis(++words, --length, value)) { _count++; } } return(false); }