Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-yamux
Commits
c6444def
Commit
c6444def
authored
Feb 17, 2021
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused segmentedBuffer.Cap() method
parent
5c564a8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
util.go
util.go
+0
-10
util_test.go
util_test.go
+3
-1
No files found.
util.go
View file @
c6444def
...
...
@@ -86,16 +86,6 @@ func (s *segmentedBuffer) Len() uint32 {
return
s
.
len
}
// Cap is the remaining capacity in the receive buffer.
//
// Note: this is _not_ the same as go's 'cap' function. The total size of the
// buffer is len+cap.
func
(
s
*
segmentedBuffer
)
Cap
()
uint32
{
s
.
bm
.
Lock
()
defer
s
.
bm
.
Unlock
()
return
s
.
cap
}
// If the space to write into + current buffer size has grown to half of the window size,
// grow up to that max size, and indicate how much additional space was reserved.
func
(
s
*
segmentedBuffer
)
GrowTo
(
max
uint32
,
force
bool
)
(
bool
,
uint32
)
{
...
...
util_test.go
View file @
c6444def
...
...
@@ -58,7 +58,9 @@ func TestSegmentedBuffer(t *testing.T) {
if
buf
.
Len
()
!=
len
{
t
.
Fatalf
(
"expected length %d, got %d"
,
len
,
buf
.
Len
())
}
if
buf
.
Cap
()
!=
cap
{
buf
.
bm
.
Lock
()
defer
buf
.
bm
.
Unlock
()
if
buf
.
cap
!=
cap
{
t
.
Fatalf
(
"expected length %d, got %d"
,
len
,
buf
.
Len
())
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment