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

8
LINES

< > BotCompany Repo | #1015377 // add_byContains - fixes return value for certain sets

JavaX fragment (include)

1  
static <A> bool add_byContains(Collection<A> c, A a) {
2  
  if (c == null) false;
3  
  synchronized(collectionMutex(c)) {
4  
    if (c.contains(a)) false;
5  
    c.add(a);
6  
    true;
7  
  }
8  
}

Author comment

Began life as a copy of #1014725

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: #1015377
Snippet name: add_byContains - fixes return value for certain sets
Eternal ID of this version: #1015377/1
Text MD5: 78f56990841b1ea64c75e140e911566f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-13 14:26:58
Source code size: 182 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 447 / 461
Referenced in: [show references]