From bad7a4b6634892d3174a940902e00704bf5007c1 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 27 Jun 2016 14:04:14 +0100 Subject: [PATCH] tidied loop with generic iteration / loop variable --- src/jalview/gui/Jalview2XML.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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()); } } -- 1.7.10.2