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) {
String name = read.getReadName();
String compressedName = read.isReducedRead() ? "C" : "";
if (readNameHash.containsKey(name))
compressedName += readNameHash.get(name).toString();
else {
final Long readNumber = readNameHash.get(name);
if (readNumber != null) {
compressedName += readNumber.toString();
} else {
readNameHash.put(name, nextReadNumber);
compressedName += nextReadNumber.toString();
nextReadNumber++;