func (b *Buffer) remove(before SeqNo) (n int, changed bool) {
	b.x__.Lock()
	defer b.x__.Unlock()
	for seqno, e := b.nremoved, b.list.Front(); e != nil && seqno < before; seqno++ {
		// Never delete the last EOF chunk, if present
		if _, isEOF := e.Value.(eof); isEOF {
			break
		}
		// Slide forward
		save := e.Next()
		// Slide cursor forward as well.
		if b.cursor == e {
			b.cursor = save
			b.seqno++
			if b.cursor != nil {
				changed = true
			}
		}
		b.list.Remove(e)
		n++          // Number of elements removed during this call
		b.nremoved++ // Number of elements removed ever
		e = save
	}
	return n, changed
}
// remove removes all chunks with sequence numbers smaller than before from the write memory.
// n equals the number of items removed from the buffer.
// changed is true if the current reading position was changed to a non-nil element;
// The cursor position can only change if it was non-nil to begin with.
remove removes all chunks with sequence numbers smaller than before from the write memory.
n equals the number of items removed from the buffer.
changed is true if the current reading position was changed to a non-nil element;
The cursor position can only change if it was non-nil to begin with.
// remove removes all chunks with sequence numbers smaller than before from the write memory . // n equals the number of items removed from the buffer . // changed is true if the current reading position was changed to a non - nil element ; // The cursor position can only change if it was non - nil to begin with .
func (b *Buffer) remove(before SeqNo) (n int, changed bool) {
	b.x__.Lock()
	defer b.x__.Unlock()
	for seqno, e := b.nremoved, b.list.Front(); e != nil && seqno < before; seqno++ {
		if _, isEOF := e.Value.(eof); isEOF {
			break
		}
		save := e.Next()
		if b.cursor == e {
			b.cursor = save
			b.seqno++
			if b.cursor != nil {
				changed = true
			}
		}
		b.list.Remove(e)
		n++          
		b.nremoved++ 
		e = save
	}
	return n, changed
}
func ( b * Buffer ) remove ( before SeqNo ) ( n int , changed bool ) { b . x__ . Lock ( ) defer b . x__ . Unlock ( ) for seqno , e := b . nremoved , b . list . Front ( ) ; e != nil && seqno < before ; seqno ++ { if _ , isEOF := e . Value . ( eof ) ; isEOF { break } save := e . Next ( ) if b . cursor == e { b . cursor = save b . seqno ++ if b . cursor != nil { changed = true } } b . list . Remove ( e ) n ++ b . nremoved ++ e = save } return n , changed }
remove removes all chunks with sequence numbers smaller than before from the write memory.
remove removes all chunks with sequence numbers smaller than before from the write memory .
// Never delete the last EOF chunk, if present // Slide forward // Slide cursor forward as well. // Number of elements removed during this call // Number of elements removed ever