Skip to content

Commit

Permalink
Perform SMARTS matching on a shallow copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Apr 2, 2017
1 parent af34a58 commit 297d568
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -203,9 +203,11 @@ private void assignHydrogenTypes(IAtomContainer container, String[] symbs, int[]
* @param symbs symbolic atom types
*/
private void assignPreliminaryTypes(IAtomContainer container, String[] symbs) {
SmartsMatchers.prepare(container, true);
// shallow copy
IAtomContainer cpy = container.getBuilder().newInstance(IAtomContainer.class, container);
SmartsMatchers.prepare(cpy, true);
for (AtomTypePattern matcher : patterns) {
for (final int idx : matcher.matches(container)) {
for (final int idx : matcher.matches(cpy)) {
if (symbs[idx] == null) {
symbs[idx] = matcher.symb;
}
Expand Down

0 comments on commit 297d568

Please sign in to comment.