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

Method short_array

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

Source from the content-addressed store, hash-verified

1336}
1337
1338@WarnBoxedMath(false)
1339static public short[] short_array(int size, Object init){
1340 short[] ret = new short[size];
1341 if(init instanceof Short)
1342 {
1343 short s = (Short) init;
1344 for(int i = 0; i < ret.length; i++)
1345 ret[i] = s;
1346 }
1347 else
1348 {
1349 ISeq s = RT.seq(init);
1350 for(int i = 0; i < size && s != null; i++, s = s.next())
1351 ret[i] = ((Number) s.first()).shortValue();
1352 }
1353 return ret;
1354}
1355
1356@WarnBoxedMath(false)
1357static public short[] short_array(Object sizeOrSeq){

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected