fn overrides(value: &CrdsValue, other: &VersionedCrdsValue) -> bool {
    assert_eq!(value.label(), other.value.label(), "labels mismatch!");
    // Node instances are special cased so that if there are two running
    // instances of the same node, the more recent start is propagated through
    // gossip regardless of wallclocks.
    if let CrdsData::NodeInstance(value) = &value.data {
        if let Some(out) = value.overrides(&other.value) {
            return out;
        }
    }
    match value.wallclock().cmp(&other.value.wallclock()) {
        Ordering::Less => false,
        Ordering::Greater => true,
        // Ties should be broken in a deterministic way across the cluster.
        // For backward compatibility this is done by comparing hash of
        // serialized values.
        Ordering::Equal => {
            let value_hash = hash(&serialize(&value).unwrap());
            other.value_hash < value_hash
        }
    }
}
// Returns true if the first value updates the 2nd one.
// Both values should have the same key/label.
Returns true if the first value updates the 2nd one.
Both values should have the same key/label.
Returns true if the first value updates the 2nd one . Both values should have the same key / label .
fn overrides(value: &CrdsValue, other: &VersionedCrdsValue) -> bool {
    assert_eq!(value.label(), other.value.label(), "labels mismatch!");
    // Node instances are special cased so that if there are two running
    // instances of the same node, the more recent start is propagated through
    // gossip regardless of wallclocks.
    if let CrdsData::NodeInstance(value) = &value.data {
        if let Some(out) = value.overrides(&other.value) {
            return out;
        }
    }
    match value.wallclock().cmp(&other.value.wallclock()) {
        Ordering::Less => false,
        Ordering::Greater => true,
        // Ties should be broken in a deterministic way across the cluster.
        // For backward compatibility this is done by comparing hash of
        // serialized values.
        Ordering::Equal => {
            let value_hash = hash(&serialize(&value).unwrap());
            other.value_hash < value_hash
        }
    }
}
fn overrides ( value : & CrdsValue , other : & VersionedCrdsValue ) -> bool { assert_eq ! ( value label ( ) other value label ( ) " " ) ; // Node instances are special cased so that if there are two running // instances of the same node, the more recent start is propagated through // gossip regardless of wallclocks. if let CrdsData :: NodeInstance ( value ) = & value . data { if let Some ( out ) = value . overrides ( & other . value ) { return out ; } } match value . wallclock ( ) . cmp ( & other . value . wallclock ( ) ) { Ordering :: Less => false , Ordering :: Greater => true , // Ties should be broken in a deterministic way across the cluster. // For backward compatibility this is done by comparing hash of // serialized values. Ordering :: Equal => { let value_hash = hash ( & serialize ( & value ) . unwrap ( ) ) ; other . value_hash < value_hash } } }
Returns true if the first value updates the 2nd one.
Returns true if the first value updates the 2nd one .
value
&CrdsValue
other
&VersionedCrdsValue