JAL-4079 avoid calling Alignment.getWidth() for each pass of a loop patch/JAL-4079_scalability_bottlenecks
authorJim Procter <j.procter@dundee.ac.uk>
Fri, 14 Oct 2022 15:35:34 +0000 (16:35 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Fri, 14 Oct 2022 15:35:34 +0000 (16:35 +0100)
src/jalview/structures/models/AAStructureBindingModel.java

index 906cb59..6ce896c 100644 (file)
@@ -700,7 +700,7 @@ public abstract class AAStructureBindingModel
             {
               refStructure = pdbfnum;
             }
-            for (int r = 0; r < alignment.getWidth(); r++)
+            for (int r = 0, wid = alignment.getWidth(); r < wid; r++)
             {
               if (!matched.get(r))
               {