297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
i--;
}
}
}
/* Find the pChild pointer for each node.
**
** The pChild points to node directly above on the same rail.
** The pChild must be in the same branch. Leaf nodes have a NULL
** pChild.
**
** In the case of a fork, choose the pChild that results in the
** longest rail.
*/
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
|
|
|
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
i--;
}
}
}
/* Find the pChild pointer for each node.
**
** The pChild points to the node directly above on the same rail.
** The pChild must be in the same branch. Leaf nodes have a NULL
** pChild.
**
** In the case of a fork, choose the pChild that results in the
** longest rail.
*/
for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
|
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
pRow->railInUse = 1<<pRow->iRail;
continue;
}
pRow->iRail = findFreeRail(p, 0, pParent->idx, inUse, pParent->iRail);
pParent->aiRaiser[pRow->iRail] = pRow->idx;
}
mask = 1<<pRow->iRail;
if( pRow->pPrev ) pRow->pPrev->railInUse |= mask;
if( pRow->pNext ) pRow->pNext->railInUse |= mask;
if( pRow->pChild==0 ){
inUse &= ~mask;
}else{
inUse |= mask;
assignChildrenToRail(pRow);
}
|
|
|
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
pRow->railInUse = 1<<pRow->iRail;
continue;
}
pRow->iRail = findFreeRail(p, 0, pParent->idx, inUse, pParent->iRail);
pParent->aiRaiser[pRow->iRail] = pRow->idx;
}
mask = 1<<pRow->iRail;
/* if( pRow->pPrev ) pRow->pPrev->railInUse |= mask; */
if( pRow->pNext ) pRow->pNext->railInUse |= mask;
if( pRow->pChild==0 ){
inUse &= ~mask;
}else{
inUse |= mask;
assignChildrenToRail(pRow);
}
|