Very bad use of the == operator with Strings was ensuring that validating GenomeLocs was very inefficient. This fix resulted in a significant speedup for a simple RodWalker.
This commit is contained in:
parent
b5de182014
commit
022832bd74
|
|
@ -87,12 +87,12 @@ public class GenomeLocParser {
|
||||||
|
|
||||||
@Requires("contig != null")
|
@Requires("contig != null")
|
||||||
public synchronized boolean hasContig(final String contig) {
|
public synchronized boolean hasContig(final String contig) {
|
||||||
return lastContig == contig || dict.getSequence(contig) != null;
|
return contig.equals(lastContig) || dict.getSequence(contig) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Requires("index >= 0")
|
@Requires("index >= 0")
|
||||||
public synchronized boolean hasContig(final int index) {
|
public synchronized boolean hasContig(final int index) {
|
||||||
return lastIndex == index|| dict.getSequence(index) != null;
|
return lastIndex == index || dict.getSequence(index) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Requires("contig != null")
|
@Requires("contig != null")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue