Skip to content

Commit 4dbf598

Browse files
committed
http2/hpack: remove unused pair function from package
Move it to a _test.go file instead. After CL 43190, the pair function is no longer used by the hpack package, so it can be removed from it. It's still used by tests. This can help avoid future readers spending time on figuring out why pair exists in package, but is not used. It can also reduce chance of the pair function unintentionally being used in the package (if that needs to happen explicitly, then pair can be easily moved back to package). Change-Id: I12ee9b46f57a522bd09e5d0ee22296df4dee1f35 Reviewed-on: https://go-review.googlesource.com/43851 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 0d77224 commit 4dbf598

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

http2/hpack/hpack_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ func TestHuffmanFuzzCrash(t *testing.T) {
648648
}
649649
}
650650

651+
func pair(name, value string) HeaderField {
652+
return HeaderField{Name: name, Value: value}
653+
}
654+
651655
func dehex(s string) []byte {
652656
s = strings.Replace(s, " ", "", -1)
653657
s = strings.Replace(s, "\n", "", -1)

http2/hpack/tables.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ func (t *headerFieldTable) idToIndex(id uint64) uint64 {
125125
return k + 1
126126
}
127127

128-
func pair(name, value string) HeaderField {
129-
return HeaderField{Name: name, Value: value}
130-
}
131-
132128
// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B
133129
var staticTable = newStaticTable()
134130
var staticTableEntries = [...]HeaderField{

0 commit comments

Comments
 (0)