Libraryless. Click here for Pure Java version (31L/1K).
1 | static <A, B> AutoCloseable tempRemove(Map<A, B> map, A key) { |
2 | if (map == null || !map.containsKey(key)) null; |
3 | B b = map.get(key); |
4 | map.remove(key); |
5 | ret autocloseable { map.put(key, b); }; |
6 | } |
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: | 145 / 219 |
Version history: | 4 change(s) |
Referenced in: | [show references] |