carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package hostclaim
2
3// SameWriterIdentity ignores claim revisions belonging to unrelated chores.
4func SameWriterIdentity(a, b Observed) bool {
5 if a.Absent || b.Absent || a.Host != b.Host || a.Claim == nil || b.Claim == nil || a.Claim.Holder == nil || b.Claim.Holder == nil {
6 return false
7 }
8 x, y := a.Claim.Holder, b.Claim.Holder
9 p, q := a.Claim.Op, b.Claim.Op
10 return x.Incarnation == y.Incarnation && x.Stamp == y.Stamp && x.Session == y.Session && x.Generation == y.Generation && x.WriterBox == y.WriterBox && p.ID == q.ID && p.Kind == q.Kind && p.Phase == q.Phase && p.Exec == q.Exec
11}
12