1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-08-04 21:42:57 +02:00

allocations improvements and tunnel fixes (#1248)

* reduce allocations in tunnel code

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* another allocation fix

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* allocate maps with len if it known

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* allocate key for send once

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Vasiliy Tolstov
2020-02-24 17:15:20 +03:00
committed by GitHub
parent 01d88601c0
commit 5b0175c2e5
13 changed files with 58 additions and 31 deletions

View File

@ -58,7 +58,7 @@ func FromContext(ctx context.Context) (Metadata, bool) {
}
// capitalise all values
newMD := make(map[string]string)
newMD := make(map[string]string, len(md))
for k, v := range md {
newMD[strings.Title(k)] = v
}