Skip to content

Commit a550aa7

Browse files
Defer sort and reindexing when loading xyzstr (schrodinger#467)
1 parent 0f79053 commit a550aa7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

layer2/ObjectMolecule.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8645,10 +8645,11 @@ ObjectMolecule *ObjectMoleculeReadStr(PyMOLGlobals * G, ObjectMolecule * I,
86458645
if(ok && isNew)
86468646
ok &= ObjectMoleculeConnect(I, cset, connect);
86478647

8648-
if (ok)
8649-
ok &= ObjectMoleculeExtendIndices(I, frame);
8650-
if (ok)
8651-
ok &= ObjectMoleculeSort(I);
8648+
if (ok) {
8649+
if (I->DiscreteFlag) {
8650+
ok &= ObjectMoleculeExtendIndices(I, frame);
8651+
}
8652+
}
86528653

86538654
deferred_tasks = true;
86548655
successCnt++;
@@ -8677,6 +8678,10 @@ ObjectMolecule *ObjectMoleculeReadStr(PyMOLGlobals * G, ObjectMolecule * I,
86778678
}
86788679
}
86798680
if(deferred_tasks && I) { /* defer time-consuming tasks until all states have been loaded */
8681+
if (!I->DiscreteFlag) {
8682+
ObjectMoleculeExtendIndices(I, cStateAll);
8683+
}
8684+
ObjectMoleculeSort(I);
86808685
if (set_formal_charges){
86818686
ObjectMoleculeMOL2SetFormalCharges(G, I);
86828687
}

0 commit comments

Comments
 (0)