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: | 408 / 400 |
Referenced in: | [show references] |