File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
base/isomorphism/src/main/java/org/openscience/cdk/isomorphism Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 3737import org .openscience .cdk .interfaces .IChemObject ;
3838import org .openscience .cdk .isomorphism .matchers .IQueryAtomContainer ;
3939
40+ import java .util .Arrays ;
4041import java .util .Iterator ;
4142import java .util .Map ;
4243
@@ -352,7 +353,14 @@ public Iterator<int[]> iterator() {
352353 * @return array of mappings
353354 */
354355 public int [][] toArray () {
355- 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 );
356364 }
357365
358366 /**
You can’t perform that action at this time.
0 commit comments