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

6
LINES

< > BotCompany Repo | #1031184 // tempRemove - temporarily remove key from map

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

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

static <A, B> AutoCloseable tempRemove(Map<A, B> map, A key) {
  if (map == null || !map.containsKey(key)) null;
  B b = map.get(key);
  map.remove(key);
  ret autocloseable { map.put(key, b); };
}

Author comment

Began life as a copy of #1017722

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031184
Snippet name: tempRemove - temporarily remove key from map
Eternal ID of this version: #1031184/5
Text MD5: f896de531e82402da0a10506d298ad46
Transpilation MD5: 903034b4b279a2ab01d49a2849469f54
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-19 20:43:01
Source code size: 202 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 144 / 217
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)