audit: codec/types: AnyUnpacker unnecessary creates a reflect.Value, boxes it then casts its to an interface just to see if it implements proto.Message, but could really just check if the original type implements the interface #17084
Labels
Type: Code Hygiene
General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Summary of Bug
Noticed while auditing changes between v0.47.0 and the latest that the code in question in cases that don't matter creates an unnecessary reflect.Value, boxes its zero value to an interface then performs a type assertion to see if it implements proto.Message
Version
3d15233
Suggestion
We can simply check against the original type that it implements proto.Message like this
/cc @ elias-orijtech
The text was updated successfully, but these errors were encountered: