From 41b744ef7d73deaedd9f06b2876f6b83129fd5b9 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 23:11:47 +0900 Subject: [PATCH] Replace `bytes.Compare` with `bytes.Equal` (#236) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- changeset.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changeset.go b/changeset.go index ccd83782..5505cf26 100644 --- a/changeset.go +++ b/changeset.go @@ -28,7 +28,7 @@ func (c Changeset) valueChanged(typ reflect.Type, old interface{}, new interface } if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Uint8 { - return bytes.Compare(reflect.ValueOf(old).Bytes(), reflect.ValueOf(new).Bytes()) != 0 + return !bytes.Equal(reflect.ValueOf(old).Bytes(), reflect.ValueOf(new).Bytes()) } return !(typ.Comparable() && old == new)