mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Make the cellMargin() routine of R-Tree slightly smaller and faster while also
fixing a harmless compiler warning. FossilOrigin-Name: 07fe6228208684d579c4f6c334c90eb6262a9233
This commit is contained in:
@ -1955,12 +1955,12 @@ static RtreeDValue cellArea(Rtree *pRtree, RtreeCell *p){
|
||||
** of the objects size in each dimension.
|
||||
*/
|
||||
static RtreeDValue cellMargin(Rtree *pRtree, RtreeCell *p){
|
||||
RtreeDValue margin;
|
||||
int ii;
|
||||
margin = DCOORD(p->aCoord[1]) - DCOORD(p->aCoord[0]);
|
||||
for(ii=2; ii<pRtree->nDim2; ii+=2){
|
||||
RtreeDValue margin = 0;
|
||||
int ii = pRtree->nDim2 - 2;
|
||||
do{
|
||||
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
|
||||
}
|
||||
ii -= 2;
|
||||
}while( ii>=0 );
|
||||
return margin;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user