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

4
LINES

< > BotCompany Repo | #1019134 // syncPut_trueIfChanged - put & synchronize on map

JavaX fragment (include)

static <A, B> bool syncPut_trueIfChanged(Map<A, B> map, A key, B value) {
  if (map == null) false;
  synchronized(map) { ret neq(map.put(key, value), value); }
}

Author comment

Began life as a copy of #1019133

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019134
Snippet name: syncPut_trueIfChanged - put & synchronize on map
Eternal ID of this version: #1019134/4
Text MD5: dbd83e69b619734ddec2d3177607de66
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-24 21:36:43
Source code size: 165 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 336 / 390
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)