Commit 4b709d93 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

http2/hpack: make staticTable an array, not a slice

Minor performance improvement, since len(staticTable) is then a
constant at compile time.

Change-Id: Ie51ecc985aa3f40d50f0a7d1ab6ac91738f696d5
Reviewed-on: https://go-review.googlesource.com/15731Reviewed-by: 's avatarDmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 29704b8f
...@@ -10,7 +10,7 @@ func pair(name, value string) HeaderField { ...@@ -10,7 +10,7 @@ func pair(name, value string) HeaderField {
} }
// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B
var staticTable = []HeaderField{ var staticTable = [...]HeaderField{
pair(":authority", ""), // index 1 (1-based) pair(":authority", ""), // index 1 (1-based)
pair(":method", "GET"), pair(":method", "GET"),
pair(":method", "POST"), pair(":method", "POST"),
......
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