Libraryless. Click here for Pure Java version (32L/1K).
1 | static <A> void putUnlessZero(Map<A, Int> map, A key, int value) {
|
2 | if (map != null && key != null && value != 0) map.put(key, value); |
3 | } |
4 | |
5 | static <A> void putUnlessZero(Map<A, Double> map, A key, double value) {
|
6 | if (map != null && key != null && value != 0) map.put(key, value); |
7 | } |
Began life as a copy of #1007227
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: | #1014218 |
| Snippet name: | putUnlessZero - put into map if int/double value != 0 |
| Eternal ID of this version: | #1014218/3 |
| Text MD5: | 9520771d30424cca1bdcd7d37fd81e5e |
| Transpilation MD5: | a2f6ba1e34f3f4165a304f6d25b1fd00 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-11-05 10:52:30 |
| Source code size: | 288 bytes / 7 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 618 / 749 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |