Libraryless. Click here for Pure Java version (2307L/15K).
1 | static <A> L<A> sortedByScoreFunction_withoutZero(Iterable<A> l, IF1<A, Number> f) {
|
2 | new Map<A, Double> map; |
3 | fOr (A a : l) {
|
4 | double score = toDouble(f.get(a)); |
5 | if (score != 0) |
6 | map.put(a, score); |
7 | } |
8 | ret keysSortedByValueDesc(map); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1027329 |
| Snippet name: | sortedByScoreFunction_withoutZero |
| Eternal ID of this version: | #1027329/2 |
| Text MD5: | 55e13ccf6030b3274d1fb42394da9a63 |
| Transpilation MD5: | 9e7500cac27528fe9cb0322f15655566 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-03-06 13:12:16 |
| Source code size: | 260 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 432 / 595 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |