mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-27 15:26:51 +00:00
proto: make use of fast-path initialization checks
Lost the check for the fast-path's Initialized output somewhere. Put it back in. name old time/op new time/op delta Required/Wire/Unmarshal-12 37.8ns ± 1% 30.5ns ± 1% -19.36% (p=0.000 n=8+8) Change-Id: Ica733366d00efba41023339a2bbd68167ab0df53 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/216897 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
0ae1c9789a
commit
ca6f40c880
@ -99,7 +99,7 @@ func (o UnmarshalOptions) unmarshal(b []byte, message Message) (out protoiface.U
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
if allowPartial {
|
||||
if allowPartial || out.Initialized {
|
||||
return out, nil
|
||||
}
|
||||
return out, isInitialized(m)
|
||||
|
Loading…
Reference in New Issue
Block a user