1 | static <A, B> LinkedHashMap<A, B> lhm_replaceFirstKey(Map<A, B> map, A newKey) { |
2 | new LinkedHashMap<A, B> out; |
3 | bool first = true; |
4 | for (A a, B b : unnull(map)) { |
5 | if (first) { |
6 | out.put(newKey, b); |
7 | first = false; |
8 | } else |
9 | out.put(a, b); |
10 | } |
11 | ret out; |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019283 |
Snippet name: | lhm_replaceFirstKey |
Eternal ID of this version: | #1019283/2 |
Text MD5: | b45d02bd5706d92995c5e8b3244dd525 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-29 12:18:54 |
Source code size: | 289 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 304 / 339 |
Version history: | 1 change(s) |
Referenced in: | [show references] |