From: gmungoc Date: Mon, 27 Jun 2016 13:04:14 +0000 (+0100) Subject: tidied loop with generic iteration / loop variable X-Git-Tag: Release_2_10_0~154^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bad7a4b6634892d3174a940902e00704bf5007c1;p=jalview.git tidied loop with generic iteration / loop variable --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index eeb4214..01e60d4 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -680,9 +680,8 @@ public class Jalview2XML Set calcIdSet = new HashSet(); // 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()); } }