Libraryless. Click here for Pure Java version (9157L/50K).
1 | svoid closeAllOpt(Iterable l) {
|
2 | if (l == null) ret; |
3 | for (O c : l) |
4 | pcall { if (c cast AutoCloseable) close(c); }
|
5 | } |
6 | |
7 | svoid closeAllOpt(O... l) {
|
8 | if (l == null) ret; |
9 | for (O c : l) |
10 | pcall { if (c cast AutoCloseable) close(c); }
|
11 | } |
Began life as a copy of #1026437
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035777 |
| Snippet name: | closeAllOpt |
| Eternal ID of this version: | #1035777/7 |
| Text MD5: | 6838d181991a4491d2d2d39b50a865f4 |
| Transpilation MD5: | 4264f0cdcb6ebcde793ae4b8e9a896a4 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-07-23 23:05:51 |
| Source code size: | 250 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 395 / 517 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |