Libraryless. Click here for Pure Java version (37L/1K).
1 | static <A> ArrayList<Long> longArrayToList(long[] a) { |
2 | if (a == null) null; |
3 | ret longArrayToList(a, 0, a.length); |
4 | } |
5 | |
6 | // no range checking on from/to in the interest of S P E E E E E EEED |
7 | static <A> ArrayList<Long> longArrayToList(long[] a, int from, int to) { |
8 | if (a == null) null; |
9 | ArrayList<Long> l = new(to-from); |
10 | for (int i = from; i < to; i++) l.add(a[i]); |
11 | ret l; |
12 | } |
Began life as a copy of #1025516
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1029189 |
Snippet name: | longArrayToList (makes an ArrayList) |
Eternal ID of this version: | #1029189/1 |
Text MD5: | 02eb9f0640fff413c2c9cc7e93ade82a |
Transpilation MD5: | c93767995720baec018b5bcf18a418fe |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-24 17:28:16 |
Source code size: | 390 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 274 / 383 |
Referenced in: | [show references] |