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

7
LINES

< > BotCompany Repo | #1009334 // setAddOrMoveToFront

JavaX fragment (include)

1  
static <A> bool setAddOrMoveToFront(L<A> l, A a) {
2  
  int i = l.indexOf(a);
3  
  if (i == 0) false;
4  
  if (i > 0) l.remove(i);
5  
  l.add(0, a);
6  
  true;
7  
}

Author comment

Began life as a copy of #1006201

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: #1009334
Snippet name: setAddOrMoveToFront
Eternal ID of this version: #1009334/2
Text MD5: d6563493b73219076d378b3567e4e73f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-23 21:46:04
Source code size: 152 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 451 / 501
Version history: 1 change(s)
Referenced in: [show references]