From c8f9728ff68ca9937cf6c3cd3438a97421c6a1c9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Jun 2022 09:23:17 +0200 Subject: [PATCH] Drop size arg from newCasemapMap It's unused. --- downstream.go | 4 ++-- irc.go | 4 ++-- upstream.go | 6 +++--- user.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/downstream.go b/downstream.go index 26032eb..81b4a66 100644 --- a/downstream.go +++ b/downstream.go @@ -348,7 +348,7 @@ func newDownstreamConn(srv *Server, ic ircConn, id uint64) *downstreamConn { nickCM: "*", username: "~u", caps: xirc.NewCapRegistry(), - monitored: newCasemapMap(0), + monitored: newCasemapMap(), registration: new(downstreamRegistration), } dc.monitored.SetCasemapping(casemapASCII) @@ -2716,7 +2716,7 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc. } uc.updateMonitor() case "C": // clear - dc.monitored = newCasemapMap(0) + dc.monitored = newCasemapMap() dc.monitored.SetCasemapping(casemapASCII) uc.updateMonitor() case "L": // list diff --git a/irc.go b/irc.go index 495771f..6399122 100644 --- a/irc.go +++ b/irc.go @@ -313,9 +313,9 @@ type casemapEntry struct { value interface{} } -func newCasemapMap(size int) casemapMap { +func newCasemapMap() casemapMap { return casemapMap{ - innerMap: make(map[string]casemapEntry, size), + innerMap: make(map[string]casemapEntry), casemap: casemapNone, } } diff --git a/upstream.go b/upstream.go index 01306c3..db04acc 100644 --- a/upstream.go +++ b/upstream.go @@ -255,7 +255,7 @@ func connectToUpstream(ctx context.Context, network *network) (*upstreamConn, er conn: *newConn(network.user.srv, newNetIRCConn(netConn), &options), network: network, user: network.user, - channels: upstreamChannelCasemapMap{newCasemapMap(0)}, + channels: upstreamChannelCasemapMap{newCasemapMap()}, caps: xirc.NewCapRegistry(), batches: make(map[string]upstreamBatch), serverPrefix: &irc.Prefix{Name: "*"}, @@ -264,7 +264,7 @@ func connectToUpstream(ctx context.Context, network *network) (*upstreamConn, er availableMemberships: stdMemberships, isupport: make(map[string]*string), pendingCmds: make(map[string][]pendingUpstreamCommand), - monitored: monitorCasemapMap{newCasemapMap(0)}, + monitored: monitorCasemapMap{newCasemapMap()}, } return uc, nil } @@ -993,7 +993,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err for _, ch := range strings.Split(channels, ",") { if uc.isOurNick(msg.Prefix.Name) { uc.logger.Printf("joined channel %q", ch) - members := membershipsCasemapMap{newCasemapMap(0)} + members := membershipsCasemapMap{newCasemapMap()} members.casemap = uc.network.casemap uc.channels.SetValue(ch, &upstreamChannel{ Name: ch, diff --git a/user.go b/user.go index aed0fb3..73221bd 100644 --- a/user.go +++ b/user.go @@ -81,7 +81,7 @@ type deliveredStore struct { } func newDeliveredStore() deliveredStore { - return deliveredStore{deliveredCasemapMap{newCasemapMap(0)}} + return deliveredStore{deliveredCasemapMap{newCasemapMap()}} } func (ds deliveredStore) HasTarget(target string) bool { @@ -141,7 +141,7 @@ type network struct { func newNetwork(user *user, record *database.Network, channels []database.Channel) *network { logger := &prefixLogger{user.logger, fmt.Sprintf("network %q: ", record.GetName())} - m := channelCasemapMap{newCasemapMap(0)} + m := channelCasemapMap{newCasemapMap()} for _, ch := range channels { ch := ch m.SetValue(ch.Name, &ch)