Skip to content
Snippets Groups Projects
Commit 6b874786 authored by Alexander Rose's avatar Alexander Rose
Browse files

only extract CrossLinkRestraints when needed

parent f9d25604
No related branches found
No related tags found
No related merge requests found
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
* Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
......@@ -89,6 +89,7 @@ function createCrossLinkRestraint(unitA: Unit, indexA: StructureElement.UnitInde
function extractCrossLinkRestraints(structure: Structure): PairRestraints<CrossLinkRestraint> {
const pairs: CrossLinkRestraint[] = []
if (!structure.models.some(m => IHMCrossLinkRestraint.fromModel(m))) return new PairRestraints(pairs)
const n = structure.units.length
for (let i = 0; i < n; ++i) {
......@@ -96,7 +97,9 @@ function extractCrossLinkRestraints(structure: Structure): PairRestraints<CrossL
extractIntra(pairs, unitA)
for (let j = i + 1; j < n; ++j) {
const unitB = structure.units[j]
extractInter(pairs, unitA, unitB)
if (unitA.model === unitB.model) {
extractInter(pairs, unitA, unitB)
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment