Libraryless. Click here for Pure Java version (3831L/22K).
1 | svoid <A> truncateTreeSetWithDuplicates(TreeSetWithDuplicates<A> set, int maxLength) {
|
2 | if (set == null) ret; |
3 | if (maxLength < 0) fail(); |
4 | while ping (l(set) > maxLength) |
5 | set.remove(set.last()); |
6 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
| Snippet ID: | #1032060 |
| Snippet name: | truncateTreeSetWithDuplicates |
| Eternal ID of this version: | #1032060/2 |
| Text MD5: | 69327c3a77df9c0c48077bcab3d2b316 |
| Transpilation MD5: | 9276948b9ff35d773553867f273bb45d |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-08-11 08:49:13 |
| Source code size: | 208 bytes / 6 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 353 / 467 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |