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

9
LINES

< > BotCompany Repo | #1030707 // removeFromMapWhereValue

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

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

1  
static <A, B> void removeFromMapWhereValue(Map<A, B> map, IPred<B> 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.getValue()))
7  
      i.remove();
8  
  }
9  
}

Author comment

Began life as a copy of #1027983

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030707
Snippet name: removeFromMapWhereValue
Eternal ID of this version: #1030707/1
Text MD5: 5f2f8ecd1a4b1e02b6f38e1892b82b91
Transpilation MD5: 6bb56548f9a77cca04a1f502c7f310aa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-13 17:36:24
Source code size: 279 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 188 / 276
Referenced in: [show references]