Libraryless. Click here for Pure Java version (32L/1K).
1 | static <A, B> Map<A, B> mapPutOrCreate(Map<A, B> map, A key, B value) {
|
2 | if (key != null && value != null) {
|
3 | if (map == null) map = new HashMap; |
4 | map.put(key, value); |
5 | } |
6 | ret map; |
7 | } |
Began life as a copy of #1024463
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: | #1024478 |
| Snippet name: | mapPutOrCreate - make HashMap if null |
| Eternal ID of this version: | #1024478/1 |
| Text MD5: | 402c4ea235170679685bf24f900f11d4 |
| Transpilation MD5: | bb90b4ee347a7fb8df4975e984546a66 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-08-13 18:48:55 |
| Source code size: | 197 bytes / 7 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 489 / 687 |
| Referenced in: | [show references] |