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

8
LINES

< > BotCompany Repo | #1016570 // getAndClearMap

JavaX fragment (include)

static <A, B> Map<A, B> getAndClearMap(Map<A, B> map) {
  if (map == null) ret emptyMap();
  synchronized(collectionMutex(map)) {
    Map<A, B> out = cloneMap(map);
    map.clear();
    ret out;
  }
}

Author comment

Began life as a copy of #1015526

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016570
Snippet name: getAndClearMap
Eternal ID of this version: #1016570/1
Text MD5: eaff8010ab08ff6e7118a32701100709
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-23 20:02:36
Source code size: 207 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 354 / 392
Referenced in: [show references]