Skip to content

Commit 3e8bced

Browse files
committed
bondMap not needed, stereo in InChI is all atom based.
1 parent affc879 commit 3e8bced

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGenerator.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,14 @@ private void generateInchiFromCDKAtomContainer(IAtomContainer atomContainer, boo
270270
}
271271

272272
// Process bonds
273-
Map<IBond, JniInchiBond> bondMap = new HashMap<IBond, JniInchiBond>();
274-
Iterator<IBond> bonds = atomContainer.bonds().iterator();
275-
while (bonds.hasNext()) {
276-
IBond bond = bonds.next();
277-
273+
for (IBond bond : atomContainer.bonds()) {
278274
// Assumes 2 centre bond
279275
JniInchiAtom at0 = (JniInchiAtom) atomMap.get(bond.getBegin());
280276
JniInchiAtom at1 = (JniInchiAtom) atomMap.get(bond.getEnd());
281277

282278
// Get bond order
283279
INCHI_BOND_TYPE order;
284-
IBond.Order bo = bond.getOrder();
280+
Order bo = bond.getOrder();
285281
if (!ignore && bond.getFlag(CDKConstants.ISAROMATIC)) {
286282
order = INCHI_BOND_TYPE.ALTERN;
287283
} else if (bo == Order.SINGLE) {
@@ -296,7 +292,6 @@ private void generateInchiFromCDKAtomContainer(IAtomContainer atomContainer, boo
296292

297293
// Create InChI bond
298294
JniInchiBond ibond = new JniInchiBond(at0, at1, order);
299-
bondMap.put(bond, ibond);
300295
input.addBond(ibond);
301296

302297
// Check for bond stereo definitions

0 commit comments

Comments
 (0)