1
0
Fork 0
forked from External/ergo

DRY mode apply code

ParseUserModeChanges and ParseChannelModeChanges already validate
that the modes are modifiable, so there's no need to repeat it here.
This commit is contained in:
Shivaram Lingamneni 2020-10-01 19:52:50 -04:00
parent b426ba628a
commit c279b2d14c
2 changed files with 16 additions and 16 deletions

View file

@ -430,8 +430,10 @@ func (a ByCodepoint) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a ByCodepoint) Less(i, j int) bool { return a[i] < a[j] }
func RplMyInfo() (param1, param2, param3 string) {
userModes := make(Modes, len(SupportedUserModes))
userModes := make(Modes, len(SupportedUserModes), len(SupportedUserModes)+1)
copy(userModes, SupportedUserModes)
// TLS is not in SupportedUserModes because it can't be modified
userModes = append(userModes, TLS)
sort.Sort(ByCodepoint(userModes))
channelModes := make(Modes, len(SupportedChannelModes)+len(ChannelUserModes))