Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1024085 // intersectionOfTwoMaps - only keys and values that are identical

JavaX fragment (include)

static Map<A, B> Map<A, B> intersectionOfTwoMaps(Map<A, B> map1, Map<A, B> map2) {
  Map<A, B> out = similarEmptyMap(map1);
  for (A a, B b : map1)
    if (eq(map2.get(a), b))
      out.put(a, b);
  ret out;
}

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: 233 / 280
Referenced in: [show references]