4f46a97599aeb8374d4ff2b41a41edae1ce76ca5 tdreszer Mon Jul 25 15:28:04 2011 -0700 Replaced tdfbExtras hash with struct for efficiency. Redmine 4674. diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c index ba5293a..0278068 100644 --- src/hg/lib/trackDbCustom.c +++ src/hg/lib/trackDbCustom.c @@ -841,61 +841,30 @@ break; if (conn == NULL) conn = hAllocConn(db); tdb->parent = hMaybeTrackInfo(conn, parentTrack); // Now there are 2 versions of this child! And what to do about views? printf("tdbFillInAncestry(%s): has %d children.",parentTrack,slCount(tdb->parent->subtracks)); //tdb->parent = tdbFindOrCreate(db,tdb,parentTrack); // Now there are 2 versions of this child! And what to do about views? } if (conn != NULL) hFreeConn(&conn); return tdb; } #endif///def OMIT -void tdbExtrasAddOrUpdate(struct trackDb *tdb,char *name,void *value) -/* Adds some "extra" information to the extras hash. Creates hash if necessary. */ -{ -if(tdb->extras == NULL) - { - tdb->extras = hashNew(7); - hashAdd(tdb->extras, name, value); - } -else - { - hashReplace(tdb->extras, name, value); - } -} - -void tdbExtrasRemove(struct trackDb *tdb,char *name) -/* Removes a value from the extras hash. */ -{ -if(tdb->extras != NULL) - hashMayRemove(tdb->extras, name); -} - -void *tdbExtrasGetOrDefault(struct trackDb *tdb,char *name,void *defaultVal) -/* Returns a value if it is found in the extras hash. */ -{ -if(tdb->extras == NULL) - return defaultVal; - -return hashOptionalVal(tdb->extras, name, defaultVal); - -} - boolean tdbIsView(struct trackDb *tdb,char **viewName) // Is this tdb a view? Will fill viewName if provided { if (tdbIsCompositeView(tdb)) { if (viewName) { *viewName = trackDbLocalSetting(tdb, "view"); assert(*viewName != NULL); } return TRUE; } return FALSE; }