Remove unused Append()

This commit is contained in:
Daisuke Maki 2016-12-14 18:23:59 +09:00
parent bac1323fe0
commit b500e2f628
3 changed files with 1 additions and 22 deletions

View file

@ -35,10 +35,6 @@ func NewFilteredBuffer(src Buffer, page, perPage int) *FilteredBuffer {
return &fb
}
func (flb *FilteredBuffer) Append(l line.Line) (line.Line, error) {
return l, nil
}
// LineAt returns the line at index `i`. Note that the i-th element
// in this filtered buffer may actually correspond to a totally
// different line number in the source buffer.
@ -60,16 +56,6 @@ func NewMemoryBuffer() *MemoryBuffer {
return mb
}
func (mb *MemoryBuffer) Append(l line.Line) {
mb.mutex.Lock()
defer mb.mutex.Unlock()
bufferAppend(&mb.lines, l)
}
func bufferAppend(lines *[]line.Line, l line.Line) {
*lines = append(*lines, l)
}
func (mb *MemoryBuffer) Size() int {
mb.mutex.RLock()
defer mb.mutex.RUnlock()

View file

@ -62,13 +62,6 @@ func (q *Query) Len() int {
return len(q.query)
}
func (q *Query) Append(r rune) {
q.mutex.Lock()
defer q.mutex.Unlock()
q.query = append(q.query, r)
}
// Runes returns a channel that gives you the list of runes in the query
func (q *Query) Runes() <-chan rune {
q.mutex.Lock()

View file

@ -188,7 +188,7 @@ func (s *Source) Append(l line.Line) {
s.mutex.Lock()
defer s.mutex.Unlock()
bufferAppend(&s.lines, l)
s.lines = append(s.lines, l)
if s.capacity > 0 && len(s.lines) > s.capacity {
diff := len(s.lines) - s.capacity