Retards the current chain iterator by the requested length. Will set the iterator to the start of the chain if the requested decrement is too great.
| Return Type | Function name | Arguments |
|---|---|---|
| hzChain::Iter& | hzChain::Iter::operator-= | (uint32_t,) |
Declared in file: hzChain.h
Defined in file : hzChain.cpp
Function Logic:
Function body:
hzChain::Iter& hzChain::Iter::operator-= (uint32_t nDec)
{
// Retards the current chain iterator by the requested length. Will set the iterator to the start of the chain if the requested decrement is too great.
//
// Arguments: 1) nInc The number of bytes to decrement the chain iterator by
//
// Returns: Reference to this chain iterator
_hzfunc("hzChain::Iter::operator-=") ;
_zblk* zp ; // Chain block pointer
zp = (_zblk*) m_block ;
for (; zp && nDec ;)
{
if (m_nOset >&eq; nDec)
{
// If we can decrement N places and still be on the same block, then just decrement the offset
m_nOset -= nDec ;
break ;
}
nDec -= m_nOset ;
if (!zp->Prev())
{
m_nOset = 0;
break ;
}
m_block = zp = zp->Prev() ;
if (zp)
m_nOset = (zp->m_nUsage - 1);
else
m_nOset = 0;
}
return *this ;
}