1 | static <A, B> L<A> keysWithValue(Map<A, B> map, B value) { |
2 | new L<A> l; |
3 | for (A key : keys(map)) |
4 | if (eq(map.get(key), value)) |
5 | l.add(key); |
6 | ret l; |
7 | } |
8 | |
9 | static <A, B> L<A> keysWithValue(B value, Map<A, B> map) { |
10 | ret keysWithValue(map, value); |
11 | } |
Began life as a copy of #1006680
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1008062 |
Snippet name: | keysWithValue - reverse map lookup |
Eternal ID of this version: | #1008062/3 |
Text MD5: | 455d4eaebfc04ec8c1eaabc656b8f757 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-04-21 13:42:20 |
Source code size: | 265 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 528 / 561 |
Version history: | 2 change(s) |
Referenced in: | [show references] |