Libraryless. Click here for Pure Java version (4540L/25K).
1 | static <A> AutoCloseable tempSetTL_noInit(BetterThreadLocal<A> tl, A a) { |
2 | if (tl == null) null; |
3 | A prev = tl.isSet() ? tl.get() : null; |
4 | if (eq(prev, a)) null; |
5 | tl.set(a); |
6 | ret autoCloseable { tl.set(prev); }; |
7 | } |
Began life as a copy of #1018288
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033545 |
Snippet name: | tempSetTL_noInit |
Eternal ID of this version: | #1033545/1 |
Text MD5: | a02e85d28d51ceb56456189bbd86720b |
Transpilation MD5: | 16e8b17942c1a8a1e2a3ca78f82f88d9 |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-11-02 02:48:52 |
Source code size: | 223 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 159 / 221 |
Referenced in: | [show references] |