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)

static <A> bool add_byContains(Collection<A> c, A a) {
  if (c == null) false;
  synchronized(collectionMutex(c)) {
    if (c.contains(a)) false;
    c.add(a);
    true;
  }
}

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