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

10
LINES

< > BotCompany Repo | #1012022 // sortByCalculatedFieldDesc_f1 - faster

JavaX fragment (include)

1  
// f: A -> Comparable
2  
static <A> L<A> sortByCalculatedFieldDesc_f1(Collection<A> c, final F1<A, ?> f) {
3  
  L<A> l = cloneList(c);
4  
  sort(l, new Comparator<A>() {
5  
    public int compare(A a, A b) {
6  
      ret stdcompare(callF(f, b), callF(f, a));
7  
    }
8  
  });
9  
  ret l;
10  
}

Author comment

Began life as a copy of #1011720

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: #1012022
Snippet name: sortByCalculatedFieldDesc_f1 - faster
Eternal ID of this version: #1012022/1
Text MD5: 4513004a1663e27185e625f1d04628d5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-16 04:55:46
Source code size: 275 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 405 / 440
Referenced in: [show references]