Libraryless. Click here for Pure Java version (31L/1K).
1 | static <A, B> void removeAndPut(Map<A, B> map, A key, B value) {
|
2 | if (map != null) {
|
3 | map.remove(key); |
4 | map.put(key, value); |
5 | } |
6 | } |
Began life as a copy of #1007227
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1031153 |
| Snippet name: | removeAndPut - first remove key, then put it into map again [for MRUCache] |
| Eternal ID of this version: | #1031153/1 |
| Text MD5: | 05a9dc8d384d103c0e7a79696d43cd59 |
| Transpilation MD5: | e510899f7cbe23541db58af63ce5a319 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-05-13 18:29:26 |
| Source code size: | 142 bytes / 6 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 383 / 483 |
| Referenced in: | [show references] |