valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.91k stars 1.76k forks source link

refactor: simplify appendArgsKeyBytes #1898

Open alexandear opened 1 week ago

alexandear commented 1 week ago

The function appendArgsKeyBytes is always called with the first parameter nil, so we can remove it.

erikdubbelboer commented 1 week ago

Nice find. I wonder if instead we should replace some of these nil with h.bufK so they don't allocate memory. Could you maybe have a look at that?