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 37
37
import org .openscience .cdk .interfaces .IChemObject ;
38
38
import org .openscience .cdk .isomorphism .matchers .IQueryAtomContainer ;
39
39
40
+ import java .util .Arrays ;
40
41
import java .util .Iterator ;
41
42
import java .util .Map ;
42
43
@@ -352,7 +353,14 @@ public Iterator<int[]> iterator() {
352
353
* @return array of mappings
353
354
*/
354
355
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 );
356
364
}
357
365
358
366
/**
You can’t perform that action at this time.
0 commit comments