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

4
LINES

< > BotCompany Repo | #1018724 // replaceOrAdd

JavaX fragment (include)

1  
static <A> L<A> replaceOrAdd(L<A> l, A a, A b) {
2  
  if (a == null) l.add(b); else replace(l, a, b);
3  
  ret l;
4  
}

Author comment

Began life as a copy of #1018718

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018724
Snippet name: replaceOrAdd
Eternal ID of this version: #1018724/1
Text MD5: 0d42acfa81d16bddad345dfe5d23a05b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-12 00:32:59
Source code size: 112 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 289 / 322
Referenced in: [show references]