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

7
LINES

< > BotCompany Repo | #1021507 // syncMoveElementRight - swap element with next in list

JavaX fragment (include)

static <A> void syncMoveElementRight(L<A> l, A a) {
  if (l == null) ret;
  synchronized(l) {
    int i = indexOf(l, a);
    if (i+1 < l(l)) swapListElements(l, i, i+1);
  }
}

Author comment

Began life as a copy of #1021506

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: #1021507
Snippet name: syncMoveElementRight - swap element with next in list
Eternal ID of this version: #1021507/1
Text MD5: 359853aa2351bd2282cc30bcdfb17e63
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-15 12:52:53
Source code size: 181 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 183 / 223
Referenced in: [show references]