SQLite

Check-in [9e6c939144]
Login

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

Overview
Comment:Save a few bytes and a few CPU cycles in sqlite3ExprListDelete() routine.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9e6c939144a129b36bb119120442a4a021e00187783da211315d4bb13acd7c3a
User & Date: drh 2017-04-05 11:57:56.171
Context
2017-04-05
12:39
Split off sqlite3DbFreeNN() from sqlite3DbFree() and use it in cases where we know that the argument to be freed is never NULL. (check-in: ad90e8bb5e user: drh tags: trunk)
11:57
Save a few bytes and a few CPU cycles in sqlite3ExprListDelete() routine. (check-in: 9e6c939144 user: drh tags: trunk)
11:49
Remove a conditional made unreachable by the previous ExprList enhancement. (check-in: a1cf447632 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/expr.c.
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661

1662
1663
1664

1665
1666
1667
1668
1669
1670
1671
1672
  }
}

/*
** Delete an entire expression list.
*/
static SQLITE_NOINLINE void exprListDeleteNN(sqlite3 *db, ExprList *pList){
  int i;
  struct ExprList_item *pItem;
  for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){

    sqlite3ExprDelete(db, pItem->pExpr);
    sqlite3DbFree(db, pItem->zName);
    sqlite3DbFree(db, pItem->zSpan);

  }
  sqlite3DbFree(db, pList);
}
void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){
  if( pList ) exprListDeleteNN(db, pList);
}

/*







|
|
|
>



>
|







1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
  }
}

/*
** Delete an entire expression list.
*/
static SQLITE_NOINLINE void exprListDeleteNN(sqlite3 *db, ExprList *pList){
  int i = pList->nExpr;
  struct ExprList_item *pItem =  pList->a;
  assert( pList->nExpr>0 );
  do{
    sqlite3ExprDelete(db, pItem->pExpr);
    sqlite3DbFree(db, pItem->zName);
    sqlite3DbFree(db, pItem->zSpan);
    pItem++;
  }while( --i>0 );
  sqlite3DbFree(db, pList);
}
void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){
  if( pList ) exprListDeleteNN(db, pList);
}

/*