Libraryless. Click here for Pure Java version (41L/1K).
1 | static HashMap litmap(O... x) { |
2 | new HashMap map; |
3 | litmap_impl(map, x); |
4 | ret map; |
5 | } |
6 | |
7 | static void litmap_impl(Map map, O... x) { |
8 | if (x != null) for (int i = 0; i < x.length-1; i += 2) |
9 | if (x[i+1] != null) |
10 | map.put(x[i], x[i+1]); |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gjtlkbvenryc, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney
No comments. add comment
Snippet ID: | #1001695 |
Snippet name: | litmap - skips null values |
Eternal ID of this version: | #1001695/5 |
Text MD5: | eaf66cbfae3fbc408d2bc72fff994f84 |
Transpilation MD5: | b9107871b8b0a568189cb356eff3f6f4 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-19 16:34:15 |
Source code size: | 252 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 900 / 2903 |
Version history: | 4 change(s) |
Referenced in: | [show references] |