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

9
LINES

< > BotCompany Repo | #1023907 // removeValue - remove from map by value

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

Libraryless. Click here for Pure Java version (50L/1K).

static <A, B> void removeValue(Map<A, B> map, B value) {
  if (map == null) ret;
  Iterator<Map.Entry<A, B>> i = map.entrySet().iterator();
  while (i.hasNext()) {
    Map.Entry e = i.next();
    if (eq(e.getValue(), value))
      i.remove();
  }
}

Author comment

Began life as a copy of #1023716

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: #1023907
Snippet name: removeValue - remove from map by value
Eternal ID of this version: #1023907/3
Text MD5: 61729fa51692610b6004feef78bebedd
Transpilation MD5: e8538b17617739f62e6c2e981ec9e8ab
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-12 01:35:14
Source code size: 256 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 241
Version history: 2 change(s)
Referenced in: [show references]