13f82230e99ae409f1128dd1d4a668af3110379e tdreszer Mon Apr 18 14:12:51 2011 -0700 Streamlined and optimized continuation line code as Jim's suggests this is critical path. diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c index b6ae4d6..5d94dc1 100644 --- src/hg/lib/trackDbCustom.c +++ src/hg/lib/trackDbCustom.c @@ -273,61 +273,61 @@ * non-NULL then only load tracks that mesh with release. */ { char *raFile = lf->fileName; char *line, *word; struct trackDb *btList = NULL, *bt; boolean done = FALSE; char *incFile; for (;;) { /* Seek to next line that starts with 'track' */ for (;;) { char *subRelease; - if (!lineFileNextFull(lf, &line, NULL)) // NOTE: lineFileNextFull joins continuation lines - { + if (!lineFileNextFull(lf, &line, NULL, NULL, NULL)) + { // NOTE: lineFileNextFull joins continuation lines done = TRUE; break; } line = skipLeadingSpaces(line); if (startsWithWord("track", line)) { - lineFileReuseFull(lf); // NOTE: lineFileReuseFull only works with previous lineFileNextFull call + lineFileReuseFull(lf); // NOTE: only works with previous lineFileNextFull call break; } else if ((incFile = trackDbInclude(raFile, line, &subRelease)) != NULL) { if (subRelease) trackDbCheckValidRelease(subRelease); if (releaseTag && subRelease && !sameString(subRelease, releaseTag)) errAbort("Include with release %s inside include with release %s line %d of %s", subRelease, releaseTag, lf->lineIx, lf->fileName); struct trackDb *incTdb = trackDbFromRa(incFile, subRelease); btList = slCat(btList, incTdb); } } if (done) break; /* Allocate track structure and fill it in until next blank line. */ bt = trackDbNew(); slAddHead(&btList, bt); for (;;) { /* Break at blank line or EOF. */ - if (!lineFileNextFull(lf, &line, NULL)) // NOTE: lineFileNextFull joins continuation lines + if (!lineFileNextFull(lf, &line, NULL, NULL, NULL)) // NOTE: joins continuation lines break; line = skipLeadingSpaces(line); if (line == NULL || line[0] == 0) break; /* Skip comments. */ if (line[0] == '#') continue; /* Parse out first word and decide what to do. */ word = nextWord(&line); if (line == NULL) errAbort("No value for %s line %d of %s", word, lf->lineIx, lf->fileName); line = trimSpaces(line); trackDbUpdateOldTag(&word, &line);