a31dd85d8e1322ae12d209aca3ce09504073493e
hiram
  Thu May 11 13:27:58 2023 -0700
I really hate trying to read !isEmpty() when there is a prefectly good equivalent isNotEmpty() no redmine

diff --git src/hg/lib/hubConnect.c src/hg/lib/hubConnect.c
index 8019f5e..739bce0 100644
--- src/hg/lib/hubConnect.c
+++ src/hg/lib/hubConnect.c
@@ -194,31 +194,31 @@
     {
     AllocVar(hub);
     hub->id = id;
     hub->hubUrl = cloneString(row[0]);
     hub->status = sqlUnsigned(row[1]);
     hub->errorMessage = cloneString(row[2]);
     hub->shortLabel = cloneString(row[4]);
     if (isEmpty(row[2]) || hubTimeToCheck(hub, row[3]))
 	{
 	char *errorMessage = NULL;
 	hub->trackHub = fetchHub( hub, &errorMessage);
         if (hub->trackHub)
             hub->trackHub->hubStatus = hub;
 	hub->errorMessage = cloneString(errorMessage);
 	hubUpdateStatus( hub->errorMessage, hub);
-	if (!isEmpty(hub->errorMessage))
+	if (isNotEmpty(hub->errorMessage))
 	    {
             boolean isCollection = (strstr(hub->hubUrl, "hgComposite") != NULL);
             if (isCollection)
                 warn("You created a <a href=\"/cgi-bin/hgCollection\"><b>Track "
          "Collection</b></a> that has expired and been removed. Track Collections "
          "expire 48 hours after their last use. <a href=\"/cgi-bin/hgSession\"><b>"
          "Save your session</b></a> to preserve collections long-term and to allow sharing.");
             // commenting this out, but leaving it in the source because we might use it later.
             //else
                 //warn("Could not connect to hub \"%s\": %s", hub->shortLabel, hub->errorMessage);
 	    }
 	}
     }
 sqlFreeResult(&sr);
 return hub;
@@ -249,31 +249,31 @@
 return hubList;
 }
 
 struct hubConnectStatus *hubConnectStatusListFromCart(struct cart *cart)
 /* Return list of track hubs that are turned on by user in cart. */
 {
 struct hubConnectStatus *hubList = NULL, *hub;
 struct slName *name, *nameList = hubConnectHubsInCart(cart);
 struct sqlConnection *conn = hConnectCentral();
 for (name = nameList; name != NULL; name = name->next)
     {
     int id = sqlSigned(name->name);
     hub = hubConnectStatusForId(conn, id);
     if (hub != NULL)
 	{
-	if (!isEmpty(hub->errorMessage) && (strstr(hub->hubUrl, "hgComposite") != NULL))
+	if (isNotEmpty(hub->errorMessage) && (strstr(hub->hubUrl, "hgComposite") != NULL))
             {
             // custom collection hub has disappeared.   Remove it from cart
             cartSetString(cart, hgHubConnectRemakeTrackHub, "on");
             char buffer[1024];
             safef(buffer, sizeof buffer, "hgHubConnect.hub.%d", id);
             cartRemove(cart, buffer);
             }
         else
             slAddHead(&hubList, hub);
 	}
     }
 slFreeList(&nameList);
 hDisconnectCentral(&conn);
 slReverse(&hubList);
 return hubList;
@@ -316,31 +316,31 @@
 trackName += 4;
 trackName = strchr(trackName, '_');
 assert(trackName != NULL);
 return trackName + 1;
 }
 
 struct hubConnectStatus *hubFromId(unsigned hubId)
 /* Given a hub ID number, return corresponding trackHub structure. 
  * ErrAbort if there's a problem. */
 {
 struct sqlConnection *conn = hConnectCentral();
 struct hubConnectStatus *status = hubConnectStatusForId(conn, hubId);
 hDisconnectCentral(&conn);
 if (status == NULL)
     errAbort("The hubId %d was not found", hubId);
-if (!isEmpty(status->errorMessage))
+if (isNotEmpty(status->errorMessage))
     errAbort("%s", status->errorMessage);
 return status;
 }
 
 static struct trackDb *findSuperTrack(struct trackDb *tdbList, char *trackName)
 /*  discover any supertracks, and if there are some add them 
  *  to the subtrack list of the supertrack */
 {
 struct trackDb *tdb;
 struct trackDb *p = NULL;
 struct trackDb *next;
 
 for(tdb = tdbList; tdb; tdb = next)
     {
     /* save away the next pointer becuase we may detach this node and
@@ -466,31 +466,31 @@
 char *statusTableName = getHubStatusTableName();
 sqlSafef(query, sizeof(query), "select id,errorMessage from %s where hubUrl = \"%s\"", statusTableName, url);
 
 struct sqlResult *sr = sqlGetResult(conn, query);
 
 while ((row = sqlNextRow(sr)) != NULL)
     {
     if (foundOne)
 	errAbort("more than one line in %s with hubUrl %s\n", 
 	    statusTableName, url);
 
     foundOne = TRUE;
 
     char *thisId = row[0], *thisError = row[1];
 
-    if (!isEmpty(thisError))
+    if (isNotEmpty(thisError))
 	*errorMessage = cloneString(thisError);
 
     id = sqlUnsigned(thisId);
     }
 sqlFreeResult(&sr);
 
 hDisconnectCentral(&conn);
 
 return id;
 }
 
 static struct hubConnectStatus *getAndSetHubStatus( struct cart *cart, char *url, 
     boolean set)
 /* make sure url is in hubStatus table, fetch the hub to get latest
  * labels and db information.
@@ -1004,89 +1004,89 @@
     curatedHubPrefix = "public";
 
 return curatedHubPrefix;
 }
 
 
 boolean hubConnectGetCuratedUrl(char *db, char **hubUrl)
 /* Check to see if this db is a curated hub and if so return its hubUrl */
 {
 struct sqlConnection *conn = hConnectCentral();
 char query[4096];
 sqlSafef(query, sizeof query, "SELECT nibPath from %s where name = '%s' AND nibPath like '%s%%'",
           dbDbTable(), db, hubCuratedPrefix);
 
 char *dir = sqlQuickString(conn, query);
-boolean ret = !isEmpty(dir);
+boolean ret = isNotEmpty(dir);
 hDisconnectCentral(&conn);
 
 if (hubUrl != NULL) // if user passed in hubUrl, calculate what it should be
     {
     *hubUrl = NULL;
-    if (!isEmpty(dir))   // this is a curated hub
+    if (ret)   // this is a curated hub
         {
         char *path = dir + sizeof(hubCuratedPrefix) - 1;
         char url[4096];
         safef(url, sizeof url, "%s/%s/hub.txt", path, getCuratedHubPrefix());
         *hubUrl = cloneString(url);
         }
     }
 
 return ret;
 }
 
 boolean hubConnectIsCurated(char *db)
 /* Look in the dbDb table to see if this hub is curated. */
 {
 return hubConnectGetCuratedUrl(db, NULL);
 }
 
 static int lookForCuratedHubs(struct cart *cart, char *db,  char *curatedHubPrefix)
 /* Check to see if db is a curated hub which will require the hub to be attached. 
  * The variable curatedHubPrefix has the release to use (alpha, beta, public, or a user name ) */
 {
 struct sqlConnection *conn = hConnectCentral();
 char query[4096];
 sqlSafef(query, sizeof query, "SELECT nibPath from %s where name = '%s' AND nibPath like '%s%%'",
           dbDbTable(), db, hubCuratedPrefix);
 
 char *dir = cloneString(sqlQuickString(conn, query));
 hDisconnectCentral(&conn);
 
-if (!isEmpty(dir))
+if (isNotEmpty(dir))
     {
     char *path = &dir[sizeof hubCuratedPrefix - 1];
     char url[4096];
     safef(url, sizeof url, "%s/%s/hub.txt", path, curatedHubPrefix);
 
     struct hubConnectStatus *status = getAndSetHubStatus( cart, url, TRUE);
 
     if (status && isEmpty(status->errorMessage))
         {
         if (cgiOptionalString("db"))
             {
             /* user specified db on URL, we need to decorate and put it back. */
             char buffer[4096];
             safef(buffer, sizeof buffer, "hub_%d_%s", status->id, db);
             cgiVarSet("db",  cloneString(buffer));
             }
 
         return status->id;
         }
     else
         {
-        if (!isEmpty(status->errorMessage))
+        if (isNotEmpty(status->errorMessage))
             errAbort("Hub error: url %s: error  %s.", url, status->errorMessage);
         else
             errAbort("Cannot open hub %s.", url);
         }
 
     }
 return 0;
 }
 
 static void portHubStatus(struct cart *cart)
 /* When a session has been saved on a different host it may have cart variables that reference hubStatus id's
  * that are different than what the local machine has.  Look for these cases using the "assumesHub" cart variable
  * that maps id numbers to URL's. */
 {
 char *assumesHubStr = cartOptionalString(cart, "assumesHub");