Skip to content

Commit

Permalink
Replace bytes.Compare with bytes.Equal (#236)
Browse files Browse the repository at this point in the history
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] committed Oct 20, 2021
1 parent d43e3ea commit 41b744e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion changeset.go
Expand Up @@ -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)
Expand Down

0 comments on commit 41b744e

Please sign in to comment.