JAL-2480 efficient test for features present on sequence
[jalview.git] / src / jalview / renderer / seqfeatures / FeatureRenderer.java
index f4648c4..d6be4c2 100644 (file)
@@ -215,13 +215,6 @@ public class FeatureRenderer extends FeatureRendererModel
       return null;
     }
 
-    SequenceFeature[] sequenceFeatures = seq.getSequenceFeatures();
-
-    if (sequenceFeatures == null || sequenceFeatures.length == 0)
-    {
-      return null;
-    }
-
     if (Comparison.isGap(seq.getCharAt(column)))
     {
       return Color.white;
@@ -270,8 +263,7 @@ public class FeatureRenderer extends FeatureRendererModel
           final SequenceI seq, int start, int end, int y1,
           boolean colourOnly)
   {
-    SequenceFeature[] sequenceFeatures = seq.getSequenceFeatures();
-    if (sequenceFeatures == null || sequenceFeatures.length == 0)
+    if (!seq.getFeatures().hasFeatures())
     {
       return null;
     }
@@ -286,7 +278,7 @@ public class FeatureRenderer extends FeatureRendererModel
     }
 
     int startPos = seq.findPosition(start);
-    int endPos = seq.findPosition(end);
+    int endPos = seq.findPosition(end);// todo a performant overload of this!
 
     Color drawnColour = null;