Update
This commit is contained in:
1 parent
3530afb854
commit
6903fcff27
2146 files changed
+112256
-190703
No files matched your search
+6
-1
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// Copyright (c) Tailscale Inc & contributors
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
// Package ringlog contains a limited-size concurrency-safe generic ring log.
|
||||
@@ -70,7 +70,12 @@ func (rb *RingLog[T]) Len() int {
|
||||
}
|
||||
|
||||
// Clear will empty the ring log.
|
||||
//
|
||||
// It does nothing if rb is nil.
|
||||
func (rb *RingLog[T]) Clear() {
|
||||
if rb == nil {
|
||||
return
|
||||
}
|
||||
rb.mu.Lock()
|
||||
defer rb.mu.Unlock()
|
||||
rb.pos = 0
|
||||
|
||||
Reference in new issue
Block a user