Libraryless. Click here for Pure Java version (2811L/16K).
static <A> A vm_generalMap_getOrCreate(O key, F0<A> create) { ret vm_generalMap_getOrCreate(key, f0ToIF0(create)); } static <A> A vm_generalMap_getOrCreate(O key, IF0<A> create) { Map generalMap = vm_generalMap(); if (generalMap == null) null; // must be x30 init synchronized(generalMap) { // should switch to locks here A a = cast vm_generalMap_get(key); if (a == null) vm_generalMap_put(key, a = create?!); ret a; } }
Began life as a copy of #1019071
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019072 |
Snippet name: | vm_generalMap_getOrCreate |
Eternal ID of this version: | #1019072/8 |
Text MD5: | d21092e6b887fd99a2c1588616dfb90a |
Transpilation MD5: | 530ba237636aea3b448e100c2277c88b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-12 00:38:29 |
Source code size: | 468 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 383 / 496 |
Version history: | 7 change(s) |
Referenced in: | [show references] |