diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 09:19:56 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 09:19:56 +0800 |
commit | baf853eda89e08b890367d5bfd018eda76ee481c (patch) | |
tree | 69f36828a98a91da43810de78e7f2e8f5cdeb631 | |
parent | Remove unnecessary anonymous function (diff) | |
download | meseircd-baf853eda89e08b890367d5bfd018eda76ee481c.tar.gz meseircd-baf853eda89e08b890367d5bfd018eda76ee481c.tar.zst meseircd-baf853eda89e08b890367d5bfd018eda76ee481c.zip |
Omit msg.Tags nil check
-rw-r--r-- | msg.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -24,7 +24,7 @@ type SMsg struct { } func (msg *SMsg) ClientSerialize() (final string) { - if msg.Tags != nil && len(msg.Tags) != 0 { + if len(msg.Tags) != 0 { final = "@" for k, v := range msg.Tags { // TODO: Tag values must be escaped @@ -48,7 +48,7 @@ func (msg *SMsg) ClientSerialize() (final string) { } func (msg *SMsg) ServerSerialize() (final string) { - if msg.Tags != nil && len(msg.Tags) != 0 { + if len(msg.Tags) != 0 { final = "@" for k, v := range msg.Tags { // TODO: Tag values must be escaped |