Locate node, insert into node. If no nodes exist, the first is create.
| Return Type | Function name | Arguments |
|---|---|---|
| uint32_t | hzIntset::Insert | (uint32_t,) |
Declared in file: hzIntset.h
Defined in file : hzIntset.cpp
Function Logic:
Function body:
uint32_t hzIntset::Insert (uint32_t nId)
{
// Locate node, insert into node. If no nodes exist, the first is create.
//
// Argument: nd The document id to insert
//
// Returns: 1 If the supplied id did not exist in the bitmap prior to this call
// 0 If the supplied id already existed in the bitmap
_hzfunc("hzIntset::Insert") ;
_idsNode* pNode ; // Target segment
int32_t rv ; // Count of number added (1)
if (!mx)
mx = new _idset_ca() ;
if (!mx->m_pData)
mx->m_pData = new _idsNode() ;
pNode = _findNode(nId) ;
if (!pNode)
return 0;
rv = pNode->Insert(nId) ;
if (rv == 1)
mx->m_nPop += 1;
// Check if node needs to split
if (pNode->m_Data.Size() > 8192)
{
}
return rv ;
}