be less redundant

This commit is contained in:
Liam Stanley 2017-02-17 05:30:29 -05:00
parent 6788aa81f8
commit e57ac9cdb4
2 changed files with 3 additions and 3 deletions

View File

@ -437,11 +437,11 @@ func (c *Client) Channels() []string {
// Lookup looks up a given channel in state. If the channel doesn't exist,
// channel is nil.
func (c *Client) Lookup(name string) (channel *Channel) {
func (c *Client) Lookup(name string) *Channel {
c.state.mu.Lock()
defer c.state.mu.Unlock()
channel = c.state.lookupChannel(name)
channel := c.state.lookupChannel(name)
if channel == nil {
return nil
}

View File

@ -194,7 +194,7 @@ func (c *Channel) Len() int {
// Lookup looks up a user in a channel based on a given nickname. If the
// user wasn't found, user is nil.
func (c *Channel) Lookup(nick string) (user *User) {
func (c *Channel) Lookup(nick string) *User {
for k, v := range c.users {
if strings.ToLower(k) == strings.ToLower(nick) {
// No need to have a copy, as if one has access to a channel,