/ Check-in [07fe6228]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the cellMargin() routine of R-Tree slightly smaller and faster while also fixing a harmless compiler warning.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 07fe6228208684d579c4f6c334c90eb6262a9233
User & Date: drh 2017-02-07 12:58:38
Context
2017-02-07
13:51
Fix SQLITE_BYTEORDER #defines in R-Tree when compiled separately from the amalgamation. check-in: a136609c user: drh tags: trunk
12:58
Make the cellMargin() routine of R-Tree slightly smaller and faster while also fixing a harmless compiler warning. check-in: 07fe6228 user: drh tags: trunk
03:44
Back out [ec8ff892ac] which is causing missed OOM errors on some tests. check-in: 0611770d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

  1951   1951   }
  1952   1952   
  1953   1953   /*
  1954   1954   ** Return the margin length of cell p. The margin length is the sum
  1955   1955   ** of the objects size in each dimension.
  1956   1956   */
  1957   1957   static RtreeDValue cellMargin(Rtree *pRtree, RtreeCell *p){
  1958         -  RtreeDValue margin;
  1959         -  int ii;
  1960         -  margin = DCOORD(p->aCoord[1]) - DCOORD(p->aCoord[0]);
  1961         -  for(ii=2; ii<pRtree->nDim2; ii+=2){
         1958  +  RtreeDValue margin = 0;
         1959  +  int ii = pRtree->nDim2 - 2;
         1960  +  do{
  1962   1961       margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
  1963         -  }
         1962  +    ii -= 2;
         1963  +  }while( ii>=0 );
  1964   1964     return margin;
  1965   1965   }
  1966   1966   
  1967   1967   /*
  1968   1968   ** Store the union of cells p1 and p2 in p1.
  1969   1969   */
  1970   1970   static void cellUnion(Rtree *pRtree, RtreeCell *p1, RtreeCell *p2){