01b4a7f506b3b44d7dcf1a8250e4829511a7cb64 chmalee Wed Aug 4 10:06:31 2021 -0700 Fixing cruft found during code review, refs #27942 diff --git src/hg/lib/hgHgvs.c src/hg/lib/hgHgvs.c index 53b8086..beb7b46 100644 --- src/hg/lib/hgHgvs.c +++ src/hg/lib/hgHgvs.c @@ -932,56 +932,54 @@ safencpy(geneSymbol, sizeof(geneSymbol), term, len); struct slName *npAccList = npForGeneSymbol(db, geneSymbol); if (npAccList != NULL) { struct slName *npItem = NULL; for (npItem = npAccList; npItem != NULL; npItem = npItem->next) { char *npAcc = npItem->name; // Make it a real HGVS term with the NP and pass that on to the usual parser. int descStartIx = 2; char *description = term + substrs[descStartIx].rm_so; struct dyString *npTerm = dyStringCreate("%s(%s):p.%s", npAcc, geneSymbol, description); slAddHead(&hgvs, hgvsParseTerm(npTerm->string)); dyStringFree(&npTerm); - //freeMem(npAcc); } } } else if (regexMatchSubstr(term, pseudoHgvsGeneSymbolProtPosExp, substrs, ArraySize(substrs))) { int len = substrs[geneSymbolIx].rm_eo - substrs[geneSymbolIx].rm_so; char geneSymbol[len+1]; safencpy(geneSymbol, sizeof(geneSymbol), term, len); struct slName *npAccList = npForGeneSymbol(db, geneSymbol); if (npAccList != NULL) { struct slName *npItem = NULL; for (npItem = npAccList; npItem != NULL; npItem = npItem->next) { char *npAcc = npItem->name; // Only position was provided, no change. Look up ref base and make a synonymous subst // so it's parseable HGVS. int posIx = 2; int pos = regexSubstringInt(term, substrs[posIx]); char refBase = refBaseForNp(db, npAcc, pos); struct dyString *npTerm = dyStringCreate("%s(%s):p.%c%d=", npAcc, geneSymbol, refBase, pos); slAddHead(&hgvs, hgvsParseTerm(npTerm->string)); dyStringFree(&npTerm); - //freeMem(npAcc); } } } else if (regexMatchSubstr(term, pseudoHgvsGeneSympolCDotPosExp, substrs, ArraySize(substrs))) { int len = substrs[geneSymbolIx].rm_eo - substrs[geneSymbolIx].rm_so; char geneSymbol[len+1]; safencpy(geneSymbol, sizeof(geneSymbol), term, len); char *nmAcc = nmForGeneSymbol(db, geneSymbol); if (isNotEmpty(nmAcc)) { // Make it a real HGVS term with the NM and pass that on to the usual parser. int descStartIx = regexSubstrMatched(substrs[2]) ? 2 : 3; char *description = term + substrs[descStartIx].rm_so; struct dyString *nmTerm = dyStringCreate("%s(%s):c.%s",