mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-06 14:39:23 +08:00
Remove redundant synchronization in NetworkHandlerSupport.setState
This commit is contained in:
parent
eba6706b47
commit
99d232efe8
@ -222,8 +222,8 @@ internal abstract class NetworkHandlerSupport(
|
||||
*/
|
||||
protected inline fun <reified S : BaseStateImpl> BaseStateImpl.setState(
|
||||
noinline new: () -> S
|
||||
): S? = synchronized(setStateLock) {
|
||||
if (_state === this) {
|
||||
): S? {
|
||||
return if (_state === this) {
|
||||
this@NetworkHandlerSupport.setState(new)
|
||||
} else {
|
||||
null
|
||||
|
Loading…
Reference in New Issue
Block a user