Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1029124 // listToHashMap - use index as key

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2471L/16K).

static <A> HashMap<Int, A> listToHashMap(L<A> l) {
  if (l == null) null;
  new HashMap<Int, A> map;
  int n = l(l);
  for i to n:
    map.put(i, l.get(i));
  ret map;
}

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: 109 / 158
Referenced in: [show references]