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

8
LINES

< > BotCompany Repo | #1018721 // replaceElementOnce

JavaX fragment (include)

static <A> L<A> replaceElementOnce(L<A> l, A a, A b) {
  for i over l:
    if (eq(l.get(i), a)) {
      l.set(i, b);
      ret l;
    }
  ret l;
}

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: #1018721
Snippet name: replaceElementOnce
Eternal ID of this version: #1018721/1
Text MD5: fa0c67a68b29147f2f0e8739e23691e9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-11 21:17:44
Source code size: 153 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 269 / 307
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)