1 | static Map<A, B> Map<A, B> intersectionOfTwoMaps(Map<A, B> map1, Map<A, B> map2) {
|
2 | Map<A, B> out = similarEmptyMap(map1); |
3 | for (A a, B b : map1) |
4 | if (eq(map2.get(a), b)) |
5 | out.put(a, b); |
6 | ret out; |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1024085 |
| Snippet name: | intersectionOfTwoMaps - only keys and values that are identical |
| Eternal ID of this version: | #1024085/1 |
| Text MD5: | a78d11695eef97ff13040fb1fc6d0f24 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-07-20 14:56:49 |
| Source code size: | 215 bytes / 7 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 422 / 480 |
| Referenced in: | [show references] |