Libraryless. Click here for Pure Java version (42L/1K).
1 | static <A> ArrayList<Float> floatArrayToList(float[] a) {
|
2 | if (a == null) null; |
3 | ret floatArrayToList(a, 0, a.length); |
4 | } |
5 | |
6 | // no range checking on from/to in the interest of speed |
7 | static <A> ArrayList<Float> floatArrayToList(float[] a, int from, int to) {
|
8 | if (a == null) null; |
9 | ArrayList<Float> 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 #1030696
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
| Snippet ID: | #1036160 |
| Snippet name: | floatArrayToList (makes an ArrayList) |
| Eternal ID of this version: | #1036160/1 |
| Text MD5: | 4136774b637e37b6bf28629c128ce5fd |
| Transpilation MD5: | 0f65d63f7cfe19d19ff65820a6efc9a0 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-10-01 09:49:00 |
| Source code size: | 385 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 352 / 448 |
| Referenced in: | [show references] |