1 | static <A> HashMap<A> twoListsToHashMap(L<A> l1, L<A> l2) { |
2 | if (l(l1) != l(l2)) fail("Differing list size: " + l(l1) + "/" + l(l2)); |
3 | new HashMap<A> map; |
4 | int n = l(l1); |
5 | for i to n: |
6 | map.put(l1.get(i), l2.get(i)); |
7 | ret map; |
8 | } |
9 | |
10 | static <A> HashMap<A> twoListsToHashMap(A[] l1, A[] l2) { |
11 | ret twoListsToHashMap(Arrays.asList(l1), Arrays.asList(l2)); |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010324 |
Snippet name: | twoListsToHashMap |
Eternal ID of this version: | #1010324/3 |
Text MD5: | cda98a83ef3f64a391c2d56a88891153 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-10-05 00:38:40 |
Source code size: | 370 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 483 / 537 |
Version history: | 2 change(s) |
Referenced in: | [show references] |