1
0
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:
drh
2017-02-07 12:58:38 +00:00
parent 76f63789f2
commit edd9bcb372
3 changed files with 12 additions and 13 deletions

View File

@ -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;
}