From e57ac9cdb46b78edeb7f9c693e8501534f52a0eb Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Fri, 17 Feb 2017 05:30:29 -0500 Subject: [PATCH] be less redundant --- client.go | 4 ++-- state.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 9883ef5..26adcdf 100644 --- a/client.go +++ b/client.go @@ -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 } diff --git a/state.go b/state.go index d684af0..af732b7 100644 --- a/state.go +++ b/state.go @@ -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,