Browse Source

Only make a best-effort to release mStacks

It doesn't *actually* matter, and getting rid of the defer is worth
~80ns of perf.
Carl Jackson 12 years ago
parent
commit
014650da07
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      web/mux.go

+ 2
- 4
web/mux.go View File

@ -74,16 +74,14 @@ func New() *Mux {
func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
stack := m.mStack.alloc()
defer m.mStack.release(stack)
stack.ServeHTTP(w, r)
m.mStack.release(stack)
}
// ServeHTTPC creates a context dependent request with the given Mux. Satisfies
// the web.Handler interface.
func (m *Mux) ServeHTTPC(c C, w http.ResponseWriter, r *http.Request) {
stack := m.mStack.alloc()
defer m.mStack.release(stack)
stack.ServeHTTPC(c, w, r)
m.mStack.release(stack)
}

Loading…
Cancel
Save