Skip to content

Commit 5e04ba8

Browse files
committed
chore: simplify getHoseCodesAtomsInternals
1 parent 6b0a203 commit 5e04ba8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hose/getHoseCodesForAtomsInternal.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function getHoseCodesForAtomsAsFragments(molecule, options = {}) {
6262
}
6363

6464
const fragments = [];
65-
const fragment = new OCL.Molecule(0, 0);
65+
6666
// keep track of the atoms when creating the fragment
6767
const mappings = [];
6868
let min = 0;
@@ -106,6 +106,7 @@ export function getHoseCodesForAtomsAsFragments(molecule, options = {}) {
106106
}
107107

108108
if (sphere >= minSphereSize) {
109+
const fragment = new OCL.Molecule(0, 0);
109110
molecule.copyMoleculeByAtoms(fragment, atomMask, true, mappings);
110111
// we using atomMapNo field in order to keep track of the original atom number even if we remove hydrogens
111112
for (let i = 0; i < fragment.getAllAtoms(); i++) {
@@ -116,7 +117,7 @@ export function getHoseCodesForAtomsAsFragments(molecule, options = {}) {
116117
makeRacemic(fragment);
117118
// we encode atom characteristics in the query features
118119
addQueryFeaturesAndRemoveMapNo(fragment, molecule);
119-
fragments.push(fragment.getCompactCopy());
120+
fragments.push(fragment);
120121
}
121122
}
122123
return fragments;

0 commit comments

Comments
 (0)