Remove removes a given Buffer from the list.
(b *Buffer)
| 286 | |
| 287 | // Remove removes a given Buffer from the list. |
| 288 | func (l *bufferList) remove(b *Buffer) { |
| 289 | l.Lock() |
| 290 | defer l.Unlock() |
| 291 | |
| 292 | for i, v := range l.list { |
| 293 | if v == b { |
| 294 | l.list = append(l.list[:i], l.list[i+1:]...) |
| 295 | break |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | // Exists checks if a given buffer is in the list. |
| 301 | func (l *bufferList) exists(b *Buffer) bool { |
no outgoing calls