From: James Procter Date: Mon, 22 May 2023 15:05:17 +0000 (+0100) Subject: JAL-4134 efficiency improvement X-Git-Tag: Release_2_11_3_0~14^2~3^2^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=279c6495df1a0de231600a2d283098c7411c4730;p=jalview.git JAL-4134 efficiency improvement --- diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index f6b842d..bb028bf 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1160,6 +1160,16 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, return; } + // TODO - sort indices for faster lookup + ColumnSelection cs = av.getColumnSelection(); + HiddenColumns hc = av.getAlignment().getHiddenColumns(); + ContactMatrixI cm = av.getContactMatrix(tp.assocAnnotation); + MappableContactMatrixI mcm = null; + int offp; + if (cm instanceof MappableContactMatrixI) + { + mcm = (MappableContactMatrixI) cm; + } for (BinaryNode bn : l) { int colm = -1; @@ -1171,15 +1181,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, { continue; } - // TODO - sort indices for faster lookup - ColumnSelection cs = av.getColumnSelection(); - HiddenColumns hc = av.getAlignment().getHiddenColumns(); - ContactMatrixI cm = av.getContactMatrix(tp.assocAnnotation); - MappableContactMatrixI mcm = null; - int offp; - if (cm instanceof MappableContactMatrixI) + if (mcm!=null) { - mcm = (MappableContactMatrixI) cm; int[] seqpos = mcm.getMappedPositionsFor( tp.assocAnnotation.sequenceRef, colm); if (seqpos == null)