Commit c6444def authored by Marten Seemann's avatar Marten Seemann

remove unused segmentedBuffer.Cap() method

parent 5c564a8b
......@@ -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) {
......
......@@ -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())
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment