|
template<class _CharT , class _Alloc >
Definition at line 1170 of file _rope.c. {
_RopeRep* __clrstack[_RopeRep::_S_max_rope_depth];
size_t __csptr = 0;
for(;;) {
// if (__r->_M_ref_count > 1) return 0;
if ( __r->_M_incr() > 2 ) {
__r->_M_decr();
return 0;
}
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
size_t __left_len = __left->_M_size._M_data;
if (__c->_M_c_string != 0) __clrstack[__csptr++] = __c;
if (__i >= __left_len) {
__i -= __left_len;
__r = __c->_M_right;
} else {
__r = __left;
}
}
break;
case _RopeRep::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
__clrstack[__csptr++] = __l;
while (__csptr > 0) {
-- __csptr;
_RopeRep* __d = __clrstack[__csptr];
__d->_M_free_c_string();
__d->_M_c_string = 0;
}
return __l->_M_data + __i;
}
case _RopeRep::_S_function:
case _RopeRep::_S_substringfn:
return 0;
}
}
#if defined(_STLP_NEED_UNREACHABLE_RETURN)
return 0;
#endif
}
|