// Keep this as a separate function so inheritors can call it in their ctors protected void Calculate(ICollection coll, IBuildContext ctxt, Fingerprint cached) { CompositeFingerprint cf = cached as CompositeFingerprint; children = new Fingerprint[coll.Count]; int i = 0; if (cf != null && cf.children.Length == coll.Count) { foreach (IFingerprintable item in coll) { children[i] = GenericFingerprints.GetFingerprint(item, ctxt, cf.children[i]); i++; } } else { foreach (IFingerprintable item in coll) { children[i] = GenericFingerprints.GetFingerprint(item, ctxt, null); i++; } } value = Calculate(children); }
// Fingerprint public override Fingerprint GetFingerprint(IBuildContext ctxt, Fingerprint cached) { return(GenericFingerprints.GetFingerprint(value, ctxt, cached)); }