1 | static <A> MultiSet<A> multiSetWithoutSingles(MultiSet<A> ms) {
|
2 | if (ms == null) null; |
3 | MultiSet<A> ms2 = similarEmptyMultiSet(ms); |
4 | for (A a : keys(ms)) {
|
5 | int n = ms.get(a); |
6 | if (n > 1) |
7 | ms2.add(a, n); |
8 | } |
9 | ret ms2; |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1021447 |
| Snippet name: | multiSetWithoutSingles |
| Eternal ID of this version: | #1021447/3 |
| Text MD5: | cc135c445fb01f5dd11720c68f48cceb |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-02-12 23:44:31 |
| Source code size: | 243 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 540 / 579 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |