summaryrefslogtreecommitdiffhomepage
path: root/pkg/buffer/buffer_list.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-24 06:37:35 +0000
committergVisor bot <gvisor-bot@google.com>2020-06-24 06:37:35 +0000
commit9183888b520beeee8609170819a28bea89202909 (patch)
tree3cdcfa4de9ced4c539ab7c57e4cf58ffea980f6c /pkg/buffer/buffer_list.go
parentcab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff)
parent364ac92baf83f2352f78b718090472639bd92a76 (diff)
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/buffer/buffer_list.go')
-rw-r--r--pkg/buffer/buffer_list.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/buffer/buffer_list.go b/pkg/buffer/buffer_list.go
index 15c7a74cc..891ea961a 100644
--- a/pkg/buffer/buffer_list.go
+++ b/pkg/buffer/buffer_list.go
@@ -56,7 +56,7 @@ func (l *bufferList) Back() *buffer {
//
// NOTE: This is an O(n) operation.
func (l *bufferList) Len() (count int) {
- for e := l.Front(); e != nil; e = e.Next() {
+ for e := l.Front(); e != nil; e = (bufferElementMapper{}.linkerFor(e)).Next() {
count++
}
return count
@@ -148,13 +148,13 @@ func (l *bufferList) Remove(e *buffer) {
if prev != nil {
bufferElementMapper{}.linkerFor(prev).SetNext(next)
- } else {
+ } else if l.head == e {
l.head = next
}
if next != nil {
bufferElementMapper{}.linkerFor(next).SetPrev(prev)
- } else {
+ } else if l.tail == e {
l.tail = prev
}