tidied loop with generic iteration / loop variable
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 27 Jun 2016 13:04:14 +0000 (14:04 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 27 Jun 2016 13:04:14 +0000 (14:04 +0100)
src/jalview/gui/Jalview2XML.java

index eeb4214..01e60d4 100644 (file)
@@ -680,9 +680,8 @@ public class Jalview2XML
     Set<String> calcIdSet = new HashSet<String>();
 
     // SAVE SEQUENCES
-    for (int i = 0; i < rjal.getHeight(); i++)
+    for (final SequenceI jds : rjal.getSequences())
     {
-      final SequenceI jds = rjal.getSequenceAt(i);
       final SequenceI jdatasq = jds.getDatasetSequence() == null ? jds
               : jds.getDatasetSequence();
       String id = seqHash(jds);
@@ -725,15 +724,15 @@ public class Jalview2XML
           jseq.setHidden(av.getAlignment().getHiddenSequences()
                   .isHidden(jds));
 
-          if (av.isHiddenRepSequence(rjal.getSequenceAt(i)))
+          if (av.isHiddenRepSequence(jds))
           {
             jalview.datamodel.SequenceI[] reps = av
-                    .getRepresentedSequences(rjal.getSequenceAt(i))
+                    .getRepresentedSequences(jds)
                     .getSequencesInOrder(rjal);
 
             for (int h = 0; h < reps.length; h++)
             {
-              if (reps[h] != rjal.getSequenceAt(i))
+              if (reps[h] != jds)
               {
                 jseq.addHiddenSequences(rjal.findIndex(reps[h]));
               }
@@ -743,7 +742,7 @@ public class Jalview2XML
         // mark sequence as reference - if it is the reference for this view
         if (jal.hasSeqrep())
         {
-          jseq.setViewreference(rjal.getSequenceAt(i) == jal.getSeqrep());
+          jseq.setViewreference(jds == jal.getSeqrep());
         }
       }