public bool Equals(Needle <T> other) { var target = _target; if (target == null) { return(other._target == null); } return(EqualsExtracted(this, other)); }
public bool Equals(Needle <T> other) { if (other is null) { return(false); } var leftTarget = _target; var rightTarget = other._target; if (leftTarget == null) { return(rightTarget == null); } return(rightTarget != null && leftTarget.Equals(rightTarget)); }
private static bool NotEqualsExtracted(Needle <T> left, Needle <T> right) { if (ReferenceEquals(left, null)) { return(!ReferenceEquals(right, null)); } if (ReferenceEquals(right, null)) { return(true); } var leftTarget = left._target; var rightTarget = right._target; if (ReferenceEquals(leftTarget, null)) { return(!ReferenceEquals(rightTarget, null)); } if (ReferenceEquals(rightTarget, null)) { return(true); } return(!leftTarget.Equals(rightTarget)); }
private static bool EqualsExtracted(Needle <T> left, Needle <T> right) { if (ReferenceEquals(left, null)) { return(ReferenceEquals(right, null)); } if (ReferenceEquals(right, null)) { return(false); } var leftTarget = left._target; var rightTarget = right._target; if (leftTarget == null) { return(rightTarget == null); } if (rightTarget == null) { return(false); } return(leftTarget.Equals(rightTarget)); }