1 | static O[] arrayrep(O a, int n) {
|
2 | O[] array = new[n]; |
3 | for i to n: array[i] = a; |
4 | ret array; |
5 | } |
6 | |
7 | static <A> A[] nuLike arrayrep(Class<A> type, A a, int n) {
|
8 | A[] array = newArray(type, n); |
9 | for i to n: array[i] = a; |
10 | ret array; |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1004057 |
| Snippet name: | arrayrep - repeat elements as an array |
| Eternal ID of this version: | #1004057/2 |
| Text MD5: | c88cbb934e107dfe4e3f364065628f5e |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-03-29 20:12:29 |
| Source code size: | 245 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 916 / 959 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |