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

4
LINES

< > BotCompany Repo | #1022178 // addToSetAndList - only add to list if not in set yet

JavaX fragment (include)

sbool <A> addToSetAndList(Set<A> set, Collection<A> list, A a) {
  if (!set.add(a)) false;
  ret true with list.add(a);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022178
Snippet name: addToSetAndList - only add to list if not in set yet
Eternal ID of this version: #1022178/1
Text MD5: 262812f5a4bdb30eea016b3eba141af1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-10 13:46:36
Source code size: 124 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 364 / 387
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)