summaryrefslogtreecommitdiffhomepage
path: root/pkg/state
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-10 02:19:26 +0000
committergVisor bot <gvisor-bot@google.com>2020-04-10 02:19:26 +0000
commit4fa86d8e40dd4bb595b7ed33290021acedb001d5 (patch)
tree32eecd1209588433b2e8ff29fb8f2fa5e6969d29 /pkg/state
parentaec346f392a983687719a813ed58c6f8b54aede9 (diff)
parent78126611e61e26269d804dd18a5229820c4ddced (diff)
Merge release-20200323.0-119-g7812661 (automated)
Diffstat (limited to 'pkg/state')
-rw-r--r--pkg/state/state.go5
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