Libraryless. Click here for Pure Java version (2494L/16K).
1 | static <A, B> void lambdaMapLike putIfHigherByCalculatedField(IF1<B, ? extends Comparable> scorer, Map<A, B> map, A key, B value) {
|
2 | if (map == null || key == null || value == null) ret; |
3 | B existing = map.get(key); |
4 | if (existing == null || cmp(scorer.get(value), scorer.get(existing)) > 0) |
5 | map.put(key, value); |
6 | } |
Began life as a copy of #1008400
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: | #1028101 |
| Snippet name: | putIfHigherByCalculatedField |
| Eternal ID of this version: | #1028101/5 |
| Text MD5: | 056694a943b52cf5d118bf2e0360bb8e |
| Transpilation MD5: | b0caeba3f2e1e7d0be8a4305fde48c5c |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-05-19 14:07:47 |
| Source code size: | 324 bytes / 6 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 429 / 599 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |