Libraryless. Click here for Pure Java version (2471L/16K).
1 | static <A> HashMap<Int, A> listToHashMap(L<A> l) { |
2 | if (l == null) null; |
3 | new HashMap<Int, A> map; |
4 | int n = l(l); |
5 | for i to n: |
6 | map.put(i, l.get(i)); |
7 | ret map; |
8 | } |
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: | #1029124 |
Snippet name: | listToHashMap - use index as key |
Eternal ID of this version: | #1029124/1 |
Text MD5: | 78a1c39b71997f42c884e9608c804a00 |
Transpilation MD5: | 349e67def8e8f516cdad6e4dfda5dd8b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-20 14:38:09 |
Source code size: | 176 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 176 / 245 |
Referenced in: | [show references] |