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

Method int_array

src/jvm/clojure/lang/Numbers.java:1272–1288  ·  view source on GitHub ↗
(int size, Object init)

Source from the content-addressed store, hash-verified

1270}
1271
1272@WarnBoxedMath(false)
1273static public int[] int_array(int size, Object init){
1274 int[] ret = new int[size];
1275 if(init instanceof Number)
1276 {
1277 int f = ((Number) init).intValue();
1278 for(int i = 0; i < ret.length; i++)
1279 ret[i] = f;
1280 }
1281 else
1282 {
1283 ISeq s = RT.seq(init);
1284 for(int i = 0; i < size && s != null; i++, s = s.next())
1285 ret[i] = ((Number) s.first()).intValue();
1286 }
1287 return ret;
1288}
1289
1290@WarnBoxedMath(false)
1291static public int[] int_array(Object sizeOrSeq){

Callers 1

doEmitMethod · 0.95

Calls 5

seqMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
countMethod · 0.95
intValueMethod · 0.45

Tested by

no test coverage detected