More size and speed improvements in the expression name resolver.

FossilOrigin-Name: e0a3d39f51a50420bae97e2bc9a8c01a5b0d3db8
diff --git a/src/resolve.c b/src/resolve.c
index 5915799..6b3caa6 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -229,7 +229,8 @@
   }
 
   /* Start at the inner-most context and move outward until a match is found */
-  while( pNC && cnt==0 ){
+  assert( pNC && cnt==0 );
+  do{
     ExprList *pEList;
     SrcList *pSrcList = pNC->pSrcList;
 
@@ -414,11 +415,11 @@
     /* Advance to the next name context.  The loop will exit when either
     ** we have a match (cnt>0) or when we run out of name contexts.
     */
-    if( cnt==0 ){
-      pNC = pNC->pNext;
-      nSubquery++;
-    }
-  }
+    if( cnt ) break;
+    pNC = pNC->pNext;
+    nSubquery++;
+  }while( pNC );
+
 
   /*
   ** If X and Y are NULL (in other words if only the column name Z is