diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-09 19:16:46 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-09 19:16:46 -0700 |
commit | 78126611e61e26269d804dd18a5229820c4ddced (patch) | |
tree | 8c1e421faa3173cb2a95187e39ee9201fd7c3b7e /pkg/state | |
parent | c560bfd1a8cd61c869e180c6cc7bb917fc29e92e (diff) | |
parent | 867eeb18d8c65019fb755194d5bdf768837f07a8 (diff) |
Merge pull request #2253 from amscanne:nogo
PiperOrigin-RevId: 305807868
Diffstat (limited to 'pkg/state')
-rw-r--r-- | pkg/state/state.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/state/state.go b/pkg/state/state.go index dbe507ab4..03ae2dbb0 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -241,10 +241,7 @@ func Register(name string, instance interface{}, fns Fns) { // // This function is used by the stateify tool. func IsZeroValue(val interface{}) bool { - if val == nil { - return true - } - return reflect.DeepEqual(val, reflect.Zero(reflect.TypeOf(val)).Interface()) + return val == nil || reflect.ValueOf(val).Elem().IsZero() } // step captures one encoding / decoding step. On each step, there is up to one |