Remove Ring.Close

This is unused.
This commit is contained in:
Simon Ser 2020-04-07 14:42:13 +02:00
parent 13635747c4
commit 7ce369958e
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 0 additions and 14 deletions

13
ring.go
View File

@ -14,7 +14,6 @@ type Ring struct {
cur uint64
consumers []*RingConsumer
closed bool
}
// NewRing creates a new ring buffer.
@ -27,10 +26,6 @@ func NewRing(capacity int) *Ring {
// Produce appends a new message to the ring buffer.
func (r *Ring) Produce(msg *irc.Message) {
if r.closed {
panic("soju: Ring.Produce called after Close")
}
i := int(r.cur % r.cap)
r.buffer[i] = msg
r.cur++
@ -40,14 +35,6 @@ func (r *Ring) Cur() uint64 {
return r.cur
}
func (r *Ring) Close() {
if r.closed {
panic("soju: Ring.Close called twice")
}
r.closed = true
}
// NewConsumer creates a new ring buffer consumer.
//
// If seq is nil, the consumer will get messages starting from the last

View File

@ -363,7 +363,6 @@ func (u *user) deleteNetwork(id int64) error {
})
net.Stop()
net.ring.Close()
u.networks = append(u.networks[:i], u.networks[i+1:]...)
return nil
}