Libraryless. Click here for Pure Java version (77L/1K).
1 | static <A> bool syncClear_trueIfChanged(Collection<A> c) { |
2 | if (c == null) false; |
3 | synchronized(collectionMutex(c)) { |
4 | if (c.isEmpty()) false; |
5 | c.clear(); |
6 | true; |
7 | } |
8 | } |
Began life as a copy of #1016980
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036362 |
Snippet name: | syncClear_trueIfChanged - clear & synchronize on collection |
Eternal ID of this version: | #1036362/1 |
Text MD5: | d74c52c81ef0aec2f61cc7da0e068eba |
Transpilation MD5: | d93419a19d69d639fe655292febef75d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-11-26 16:53:09 |
Source code size: | 185 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 120 / 171 |
Referenced in: | [show references] |