Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
link1st committed Jun 12, 2024
1 parent 2222acb commit 1916fbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion servers/websocket/client_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (manager *ClientManager) DelUsers(client *Client) (result bool) {

// GetUserKeys 获取用户的key
func (manager *ClientManager) GetUserKeys() (userKeys []string) {
userKeys = make([]string, len(manager.Users))
userKeys = make([]string, 0, len(manager.Users))
for key := range manager.Users {
userKeys = append(userKeys, key)
}
Expand Down

0 comments on commit 1916fbc

Please sign in to comment.