ec4aa63c0938b8166f55a9cab045e12827685742 kent Tue Jul 19 13:50:10 2011 -0700 Optimizing parentChildCartCleanup by creating a faster version of cartVarsWithPrefix that works in local memory. diff --git src/hg/inc/cart.h src/hg/inc/cart.h index ff97e39..9c21f1d 100644 --- src/hg/inc/cart.h +++ src/hg/inc/cart.h @@ -85,30 +85,34 @@ void cartRemove(struct cart *cart, char *var); /* Remove variable from cart. */ void cartRemoveExcept(struct cart *cart, char **except); /* Remove variables except those in null terminated except array * from cart. Except array may be NULL in which case all * are removed. */ struct slPair *cartVarsLike(struct cart *cart, char *wildCard); /* Return a slPair list of cart vars that match the wildcard */ struct slPair *cartVarsWithPrefix(struct cart *cart, char *prefix); /* Return a slPair list of cart vars that begin with prefix */ +struct slPair *cartVarsWithPrefixLm(struct cart *cart, char *prefix, struct lm *lm); +/* Return list of cart vars that begin with prefix allocated in local memory. + * Quite a lot faster than cartVarsWithPrefix. */ + void cartRemoveLike(struct cart *cart, char *wildCard); /* Remove all variable from cart that match wildCard. */ void cartRemovePrefix(struct cart *cart, char *prefix); /* Remove variables with given prefix from cart. */ boolean cartVarExists(struct cart *cart, char *var); /* Return TRUE if variable is in cart. */ boolean cartListVarExists(struct cart *cart, char *var); /* Return TRUE if a list variable is in cart (list may still be empty). */ INLINE boolean cartVarExistsDb(struct cart *cart, char *db, char *var) /* Return TRUE if variable_$db is in cart. */ { @@ -520,34 +524,29 @@ /* Remove all variables from cart that are associated with this tdb and it's children. */ char *cartOrTdbString(struct cart *cart, struct trackDb *tdb, char *var, char *defaultVal); /* Look first in cart, then in trackDb for var. Return defaultVal if not found. */ int cartOrTdbInt(struct cart *cart, struct trackDb *tdb, char *var, int defaultVal); /* Look first in cart, then in trackDb for var. Return defaultVal if not found. */ double cartOrTdbDouble(struct cart *cart, struct trackDb *tdb, char *var, double defaultVal); /* Look first in cart, then in trackDb for var. Return defaultVal if not found. */ boolean cartValueHasChanged(struct cart *newCart,struct hash *oldVars,char *setting,boolean ignoreRemoved,boolean ignoreCreated); /* Returns TRUE if new cart setting has changed from old cart setting */ -int cartNamesPruneChanged(struct cart *newCart,struct hash *oldVars, - struct slPair **cartNames,boolean ignoreRemoved,boolean unChanged); -/* Prunes a list of cartNames if the settings have changed between new and old cart. - Returns pruned count */ - int cartRemoveFromTdbTree(struct cart *cart,struct trackDb *tdb,char *suffix,boolean skipParent); /* Removes a 'trackName.suffix' from all tdb descendents (but not parent). If suffix NULL then removes 'trackName' which holds visibility */ boolean cartTdbTreeReshapeIfNeeded(struct cart *cart,struct trackDb *tdbComposite); /* When subtrack vis is set via findTracks, and composite has no cart settings, then fashion composite to match found */ -boolean cartTdbTreeCleanupOverrides(struct trackDb *tdb,struct cart *newCart,struct hash *oldVars); +boolean cartTdbTreeCleanupOverrides(struct trackDb *tdb,struct cart *newCart,struct hash *oldVars, struct lm *lm); /* When composite/view settings changes, remove subtrack specific settings Returns TRUE if any cart vars are removed */ #endif /* CART_H */