server: remove duplicate code (#1346)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-03-14 01:15:09 +03:00 committed by GitHub
parent 60993e6275
commit 609f4826b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -547,18 +547,6 @@ func (router *router) ProcessMessage(ctx context.Context, msg Message) (err erro
req = req.Elem() req = req.Elem()
} }
if handler.reqType.Kind() == reflect.Ptr {
req = reflect.New(handler.reqType.Elem())
} else {
req = reflect.New(handler.reqType)
isVal = true
}
// if its a value get the element
if isVal {
req = req.Elem()
}
cc := msg.Codec() cc := msg.Codec()
// read the header. mostly a noop // read the header. mostly a noop