Skip to content

Commit

Permalink
Use bytes.Equal
Browse files Browse the repository at this point in the history
Signed-off-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>
  • Loading branch information
nak3 committed Aug 9, 2023
1 parent 4299cfa commit fa431c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion v2/jsonpatch.go
@@ -1,6 +1,7 @@
package jsonpatch

import (
"bytes"
"encoding/json"
"fmt"
"reflect"
Expand Down Expand Up @@ -64,7 +65,7 @@ func NewOperation(op, path string, value interface{}) Operation {
//
// An error will be returned if any of the two documents are invalid.
func CreatePatch(a, b []byte) ([]Operation, error) {
if reflect.DeepEqual(a, b) {
if bytes.Equal(a, b) {
return []Operation{}, nil
}
var aI interface{}
Expand Down

0 comments on commit fa431c2

Please sign in to comment.