ShinyNode* ShinyNodeState_finishAndGetNextClean(ShinyNodeState *self) { ShinyNode *node = self->node; ShinyZone *zone = node->zone; if (self->zoneUpdating) { zone->data.childTicks.cur += node->data.childTicks.cur; zone->_state = SHINY_ZONE_STATE_INITIALIZED; } ShinyData_copyAverage(&node->data); if (!ShinyNode_isRoot(node)) node->parent->data.childTicks.cur += node->data.selfTicks.cur + node->data.childTicks.cur; return node->nextSibling; }
const ShinyNode* ShinyNode_findNextInTree(const ShinyNode* self) { if (self->firstChild) { return self->firstChild; } else if (self->nextSibling) { return self->nextSibling; } else { ShinyNode* pParent = self->parent; while (!ShinyNode_isRoot(pParent)) { if (pParent->nextSibling) return pParent->nextSibling; else pParent = pParent->parent; } return NULL; } }