There was an error while loading. Please reload this page.
1 parent a339734 commit 2e4ceabCopy full SHA for 2e4ceab
1 file changed
base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java
@@ -37,6 +37,7 @@
37
import org.openscience.cdk.interfaces.IChemObject;
38
import org.openscience.cdk.isomorphism.matchers.IQueryAtomContainer;
39
40
+import java.util.Arrays;
41
import java.util.Iterator;
42
import java.util.Map;
43
@@ -352,7 +353,14 @@ public Iterator<int[]> iterator() {
352
353
* @return array of mappings
354
*/
355
public int[][] toArray() {
- return Iterables.toArray(iterable, int[].class);
356
+ int[][] res = new int[14][];
357
+ int size = 0;
358
+ for (int[] map : this) {
359
+ if (size == res.length)
360
+ res = Arrays.copyOf(res, size + (size >> 1));
361
+ res[size++] = map.clone();
362
+ }
363
+ return Arrays.copyOf(res, size);
364
}
365
366
/**
0 commit comments