Libraryless. Click here for Pure Java version (66L/1K).
static <A, B> TreeMap<A, B> asTreeMap(Map<A, B> map, Comparator<A> comparator default null) { if (map cast TreeMap && eq(map.comparator(), comparator)) ret map; var m2 = new TreeMap(comparator); m2.putAll(map); ret m2; } static <A, B> TreeMap<A, B> asTreeMap(Comparator<A> comparator, Map<A, B> map) { ret asTreeMap(map, comparator); }
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/5 |
Text MD5: | 899215be3909dd2dc73bc963ccca2ad3 |
Transpilation MD5: | c600ad12764055df3fc874cd7d3f9017 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-10-31 14:08:22 |
Source code size: | 360 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 590 / 633 |
Version history: | 4 change(s) |
Referenced in: | [show references] |