Libraryless. Click here for Pure Java version (37L/1K).
1 | static <A> ArrayList<Double> doubleArrayToList(double[] a) { |
2 | if (a == null) null; |
3 | ret doubleArrayToList(a, 0, a.length); |
4 | } |
5 | |
6 | // no range checking on from/to in the interest of speed |
7 | static <A> ArrayList<Double> doubleArrayToList(double[] a, int from, int to) { |
8 | if (a == null) null; |
9 | ArrayList<Double> 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 #1030689
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030696 |
Snippet name: | doubleArrayToList (makes an ArrayList) |
Eternal ID of this version: | #1030696/1 |
Text MD5: | a0645a2c1a99bba3ad4ce26a42cc775c |
Transpilation MD5: | 0997f0fa42ac3373183d8254fe76e1cb |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-03-08 12:24:25 |
Source code size: | 393 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 242 / 323 |
Referenced in: | [show references] |