Replace with map.containsKey followed by map.get with map.get followed by null check.

This commit is contained in:
Alec Wysoker 2013-02-07 11:58:41 -05:00
parent 72e496d6f3
commit e88bc753aa
1 changed files with 4 additions and 3 deletions

View File

@ -627,9 +627,10 @@ public class ReduceReads extends ReadWalker<LinkedList<GATKSAMRecord>, ReduceRea
private void compressReadName(GATKSAMRecord read) { private void compressReadName(GATKSAMRecord read) {
String name = read.getReadName(); String name = read.getReadName();
String compressedName = read.isReducedRead() ? "C" : ""; String compressedName = read.isReducedRead() ? "C" : "";
if (readNameHash.containsKey(name)) final Long readNumber = readNameHash.get(name);
compressedName += readNameHash.get(name).toString(); if (readNumber != null) {
else { compressedName += readNumber.toString();
} else {
readNameHash.put(name, nextReadNumber); readNameHash.put(name, nextReadNumber);
compressedName += nextReadNumber.toString(); compressedName += nextReadNumber.toString();
nextReadNumber++; nextReadNumber++;