Warning: session_start(): open(/var/lib/php/sessions/sess_635hgm49f0nkm5so1h9fc06m7f, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51

Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
putLongUnique - add to map with long keys, increment until free slot; sync on map [1014608]

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

7
LINES

< > BotCompany Repo | #1014608 // putLongUnique - add to map with long keys, increment until free slot; sync on map

JavaX fragment (include)

1  
static <A> long putLongUnique(Map<Long, A> map, long key, A value) {
2  
  synchronized (collectionMutex(map)) {
3  
    while (map.containsKey(key)) ++key;
4  
    map.put(key, value);
5  
  }
6  
  ret key;
7  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014608
Snippet name: putLongUnique - add to map with long keys, increment until free slot; sync on map
Eternal ID of this version: #1014608/1
Text MD5: bc7a957363a074e2c60861650cd501ce
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-26 17:15:21
Source code size: 196 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 773 / 742
Referenced in: [show references]