From fa9f582e19475e7a94769fd8fa4bee5d270f994e Mon Sep 17 00:00:00 2001 From: ruokeqx Date: Mon, 20 Nov 2023 13:01:48 +0800 Subject: [PATCH] fix --- README.md | 4 ++-- examples/circularbuffer/circularbuffer.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a629624b..1dbbe2ca 100644 --- a/README.md +++ b/README.md @@ -974,10 +974,10 @@ func main() { queue.Enqueue(3) // 1, 2, 3 _ = queue.Values() // 1, 2, 3 queue.Enqueue(4) // 4, 2, 3 - _, _ = queue.Peek() // 4,true - _, _ = queue.Dequeue() // 4, true + _, _ = queue.Peek() // 2, true _, _ = queue.Dequeue() // 2, true _, _ = queue.Dequeue() // 3, true + _, _ = queue.Dequeue() // 4, true _, _ = queue.Dequeue() // nil, false (nothing to deque) queue.Enqueue(1) // 1 queue.Clear() // empty diff --git a/examples/circularbuffer/circularbuffer.go b/examples/circularbuffer/circularbuffer.go index 77b3bd09..fd4ec3d5 100644 --- a/examples/circularbuffer/circularbuffer.go +++ b/examples/circularbuffer/circularbuffer.go @@ -14,10 +14,10 @@ func main() { queue.Enqueue(3) // 1, 2, 3 _ = queue.Values() // 1, 2, 3 queue.Enqueue(4) // 4, 2, 3 - _, _ = queue.Peek() // 4,true - _, _ = queue.Dequeue() // 4, true + _, _ = queue.Peek() // 2,true _, _ = queue.Dequeue() // 2, true _, _ = queue.Dequeue() // 3, true + _, _ = queue.Dequeue() // 4, true _, _ = queue.Dequeue() // nil, false (nothing to deque) queue.Enqueue(1) // 1 queue.Clear() // empty