Libraryless. Click here for Pure Java version (2152L/14K).
static <A> Set<A> set_moveFirst(Iterable<A> items, Set<A> set) { new LinkedHashSet<A> out; Set<A> remaining = cloneSet(set); for (A a : items) if (remaining.remove(a)) out.add(a); out.addAll(remaining); ret out; }
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1026013 |
Snippet name: | set_moveFirst - move elements to beginning of set |
Eternal ID of this version: | #1026013/2 |
Text MD5: | 8423d2fb87d6b8016efcbdf9cd2807eb |
Transpilation MD5: | 2642e391e6119516b4c353997fbf3605 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-11-07 14:07:08 |
Source code size: | 241 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 180 / 272 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1030795 - moveItemFirst - move element to beginning of (cloned) list |