Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / datamodel / SequenceGroup.java
index 3bf7bc4..861595c 100755 (executable)
@@ -269,16 +269,15 @@ public class SequenceGroup implements AnnotatedCollectionI
     for (int i = 0, ipos = 0; i < inorder.length; i++)
     {
       SequenceI seq = inorder[i];
-
-      seqs[ipos] = seq.getSubSequence(startRes, endRes + 1);
-      if (seqs[ipos] != null)
+      SequenceI seqipos = seqs[ipos] = seq.getSubSequence(startRes, endRes + 1);
+      if (seqipos != null)
       {
-        seqs[ipos].setDescription(seq.getDescription());
-        seqs[ipos].setDBRefs(seq.getDBRefs());
-        seqs[ipos].setSequenceFeatures(seq.getSequenceFeatures());
+        seqipos.setDescription(seq.getDescription());
+        seqipos.setDBRefs(seq.getDBRefs());
+        seqipos.setSequenceFeatures(seq.getSequenceFeatures());
         if (seq.getDatasetSequence() != null)
         {
-          seqs[ipos].setDatasetSequence(seq.getDatasetSequence());
+          seqipos.setDatasetSequence(seq.getDatasetSequence());
         }
 
         if (seq.getAnnotation() != null)
@@ -292,7 +291,7 @@ public class SequenceGroup implements AnnotatedCollectionI
             if (alann != null)
             {
               boolean found = false;
-              for (int pos = 0; pos < alann.length; pos++)
+              for (int pos = 0, np = alann.length; pos < np; pos++)
               {
                 if (alann[pos] == tocopy)
                 {
@@ -310,7 +309,7 @@ public class SequenceGroup implements AnnotatedCollectionI
             newannot.restrict(startRes, endRes);
             newannot.setSequenceRef(seqs[ipos]);
             newannot.adjustForAlignment();
-            seqs[ipos].addAlignmentAnnotation(newannot);
+            seqipos.addAlignmentAnnotation(newannot);
           }
         }
         ipos++;