MCPcopy Index your code
hub / github.com/clojure/clojure / seqToPassedArray

Method seqToPassedArray

src/jvm/clojure/lang/RT.java:1751–1763  ·  view source on GitHub ↗
(ISeq seq, Object[] passed)

Source from the content-addressed store, hash-verified

1749
1750 // supports java Collection.toArray(T[])
1751 static public Object[] seqToPassedArray(ISeq seq, Object[] passed){
1752 Object[] dest = passed;
1753 int len = count(seq);
1754 if (len > dest.length) {
1755 dest = (Object[]) Array.newInstance(passed.getClass().getComponentType(), len);
1756 }
1757 for(int i = 0; seq != null; ++i, seq = seq.next())
1758 dest[i] = seq.first();
1759 if (len < passed.length) {
1760 dest[len] = null;
1761 }
1762 return dest;
1763 }
1764
1765static public Object seqToTypedArray(ISeq seq) {
1766 Class type = (seq != null && seq.first() != null) ? seq.first().getClass() : Object.class;

Callers 5

toArrayMethod · 0.95
toArrayMethod · 0.95
toArrayMethod · 0.95
toArrayMethod · 0.95
toArrayMethod · 0.95

Calls 4

countMethod · 0.95
newInstanceMethod · 0.80
nextMethod · 0.65
firstMethod · 0.65

Tested by

no test coverage detected