mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
move StringSet to utils package
This commit is contained in:
parent
ddac7d94a8
commit
df8be72c6f
9 changed files with 50 additions and 40 deletions
|
|
@ -4,15 +4,16 @@
|
|||
package irc
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"encoding/json"
|
||||
"github.com/tidwall/buntdb"
|
||||
|
||||
"github.com/oragono/oragono/irc/modes"
|
||||
"github.com/tidwall/buntdb"
|
||||
"github.com/oragono/oragono/irc/utils"
|
||||
)
|
||||
|
||||
// this is exclusively the *persistence* layer for channel registration;
|
||||
|
|
@ -140,8 +141,8 @@ func (reg *ChannelRegistry) AllChannels() (result []string) {
|
|||
}
|
||||
|
||||
// PurgedChannels returns the set of all casefolded channel names that have been purged
|
||||
func (reg *ChannelRegistry) PurgedChannels() (result map[string]empty) {
|
||||
result = make(map[string]empty)
|
||||
func (reg *ChannelRegistry) PurgedChannels() (result utils.StringSet) {
|
||||
result = make(utils.StringSet)
|
||||
|
||||
prefix := fmt.Sprintf(keyChannelPurged, "")
|
||||
reg.server.store.View(func(tx *buntdb.Tx) error {
|
||||
|
|
@ -150,7 +151,7 @@ func (reg *ChannelRegistry) PurgedChannels() (result map[string]empty) {
|
|||
return false
|
||||
}
|
||||
channel := strings.TrimPrefix(key, prefix)
|
||||
result[channel] = empty{}
|
||||
result.Add(channel)
|
||||
return true
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue