Skip to content

Commit

Permalink
Fix checkpoint compare
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove committed Feb 26, 2021
1 parent 7ed712a commit f96e2ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/checkpoint/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,16 @@ next_set:
if cf.eq == nil {
continue
}
if !cf.eq(ma[cf.field], mb[cf.field]) {
if !contains(ma, cf.field) || !contains(mb, cf.field) || !cf.eq(ma[cf.field], mb[cf.field]) {
continue next_set
}
}
return true
}
return false
}

func contains(m map[string]interface{}, f string) bool {
_, ok := m[f]
return ok
}

0 comments on commit f96e2ca

Please sign in to comment.