diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-13 20:11:56 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-13 20:11:56 +0000 |
commit | f8e003defed3b62890933a3d7eaaaee2529d413b (patch) | |
tree | b9578ae0be7b08891f2acb7f90c87a93409a90c3 /pkg/tcpip/buffer | |
parent | 8b0712eb214705d5af3d2b726866e093d86d89fe (diff) | |
parent | 47515f475167ffa23267ca0b9d1b39e7907587d6 (diff) |
Merge release-20200810.0-23-g47515f475 (automated)
Diffstat (limited to 'pkg/tcpip/buffer')
-rw-r--r-- | pkg/tcpip/buffer/view.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/view.go b/pkg/tcpip/buffer/view.go index 9a3c5d6c3..ea0c5413d 100644 --- a/pkg/tcpip/buffer/view.go +++ b/pkg/tcpip/buffer/view.go @@ -65,6 +65,16 @@ func (v View) ToVectorisedView() VectorisedView { return NewVectorisedView(len(v), []View{v}) } +// IsEmpty returns whether v is of length zero. +func (v View) IsEmpty() bool { + return len(v) == 0 +} + +// Size returns the length of v. +func (v View) Size() int { + return len(v) +} + // VectorisedView is a vectorised version of View using non contiguous memory. // It supports all the convenience methods supported by View. // |