1 | static <A, B> Map<A, Set<B>> pairsToMapWithSetValues(LPair<A, B> l) { |
2 | new Map<A, Set<B>> mm; |
3 | for (Pair<A, B> p : unnull(l)) { |
4 | Set<B> set = mm.get(p.a); |
5 | if (set == null) mm.put(p.a, set = new HashSet); |
6 | set.add(p.b); |
7 | } |
8 | ret mm; |
9 | } |
Began life as a copy of #1020567
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020568 |
Snippet name: | pairsToMapWithSetValues |
Eternal ID of this version: | #1020568/2 |
Text MD5: | 4047fe22c2770e3deb4eb1f2466cff12 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-27 01:25:48 |
Source code size: | 254 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 285 / 329 |
Version history: | 1 change(s) |
Referenced in: | [show references] |