From: Jim Procter Date: Fri, 14 Oct 2022 15:35:34 +0000 (+0100) Subject: JAL-4079 avoid calling Alignment.getWidth() for each pass of a loop X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fpatch%2FJAL-4079_scalability_bottlenecks;p=jalview.git JAL-4079 avoid calling Alignment.getWidth() for each pass of a loop --- diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index 906cb59..6ce896c 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -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)) {