public TreeNode(string name, NodeKind kind, Sha1 sha1) : this(name, sha1, kind) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name)); } if (!Enum.IsDefined(typeof(NodeKind), kind)) { throw new ArgumentOutOfRangeException(nameof(kind)); } }
public override int GetHashCode(Sha1 obj) { var hc = 17L; unchecked { hc = (hc * 23) + (long)obj.Blit0; hc = (hc * 23) + (long)obj.Blit1; hc = (hc * 23) + obj.Blit2; } return(((int)(hc >> 32)) ^ (int)hc); }
public override int Compare(Sha1 x, Sha1 y) { // CLR returns [-1, 0, +1] for ulong/uint comparisons (vs arbitrary neg/pos values) var cmp = x.Blit0.CompareTo(y.Blit0); if (cmp != 0) { return(cmp); } cmp = x.Blit1.CompareTo(y.Blit1); if (cmp != 0) { return(cmp); } cmp = x.Blit2.CompareTo(y.Blit2); return(cmp); }
public void Deconstruct(out string name, out NodeKind kind, out Sha1 sha1) { name = Name; sha1 = Sha1; kind = Kind; }
public CommitId(Sha1 sha1) { Sha1 = sha1; }
public TreeId(Sha1 sha1) { Sha1 = sha1; }
public override bool Equals(Sha1 x, Sha1 y) => x.Blit0 == y.Blit0 && x.Blit1 == y.Blit1 && x.Blit2 == y.Blit2;
public BlobId(Sha1 sha1) { Sha1 = sha1; }