Skip to content

Commit a74ffe4

Browse files
committed
unlock mutex faster
1 parent c0df446 commit a74ffe4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func (h *Client) updateIPAddr() error {
111111
}
112112

113113
h.mu.Lock()
114-
defer h.mu.Unlock()
115114
h.ipAddr = body
115+
h.mu.Unlock()
116116
return nil
117117
}
118118

@@ -159,8 +159,8 @@ func (h *Client) getAccountKeys(account *APIAccount) error {
159159
}
160160

161161
h.mu.Lock()
162-
defer h.mu.Unlock()
163162
account.Keys = body.Keys
163+
h.mu.Unlock()
164164
return nil
165165
}
166166

0 commit comments

Comments
 (0)