Libraryless. Click here for Pure Java version (94L/1K).
1 | static <A, B> TreeMap<A, B> asTreeMap(Map<A, B> map, Comparator<A> comparator default null) { |
2 | if (map cast TreeMap && eq(map.comparator(), comparator)) |
3 | ret map; |
4 | var m2 = new TreeMap(comparator); |
5 | putAll(m2, map); |
6 | ret m2; |
7 | } |
8 | |
9 | static <A, B> TreeMap<A, B> asTreeMap(Comparator<A> comparator, Map<A, B> map) { |
10 | ret asTreeMap(map, comparator); |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1005222 |
Snippet name: | asTreeMap |
Eternal ID of this version: | #1005222/6 |
Text MD5: | 7d23eb2091ec1867f1992a87f0428966 |
Transpilation MD5: | 7dbc6447b0cb3f86c13a46a0a1a3ff94 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2024-05-18 22:21:34 |
Source code size: | 361 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 723 / 818 |
Version history: | 5 change(s) |
Referenced in: | [show references] |