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

9
LINES

< > BotCompany Repo | #1027983 // removeFromMapWhere

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2482L/16K).

1  
static <A, B> void removeFromMapWhere(Map<A, B> map, IF2<A, B, Bool> pred) {
2  
  if (map == null) ret;
3  
  Iterator<Map.Entry<A, B>> i = map.entrySet().iterator();
4  
  while (i.hasNext()) {
5  
    Map.Entry<A, B> e = i.next();
6  
    if (pred.get(e.getKey(), e.getValue()))
7  
      i.remove();
8  
  }
9  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027983
Snippet name: removeFromMapWhere
Eternal ID of this version: #1027983/4
Text MD5: 91bac7268997aa4a79e7bdcf0acf8ba9
Transpilation MD5: d232d7dc88281a0ee6e3e198308c82aa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-23 10:16:26
Source code size: 293 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 198 / 284
Version history: 3 change(s)
Referenced in: [show references]