Table of Contents

Class Checks

Namespace
Garyon.Functions
Assembly
Garyon.dll

Contains functions regarding checking values.

public static class Checks
Inheritance
Checks
Inherited Members

Methods

SafeEqualsEquatable<T>(T, T)

Determines whether two objects are equal using the Equals(object) method without triggering a NullReferenceException.

public static bool SafeEqualsEquatable<T>(T left, T right) where T : class?, IEquatable<T>?

Parameters

left T

The left object to compare.

right T

The right object to compare.

Returns

bool

true if both objects are equal, or both are null; otherwise false.

Type Parameters

T

The type of the objects to compare.

Remarks

This implementation utilizes the Equals(T) function in order to avoid the type checking overhead.

SafeEquals<T>(T, T)

Determines whether two objects are equal using the Equals(object) method without triggering a NullReferenceException.

public static bool SafeEquals<T>(T left, T right)

Parameters

left T

The left object to compare.

right T

The right object to compare.

Returns

bool

true if both objects are equal, or both are null; otherwise false.

Type Parameters

T

The type of the objects to compare.

Remarks

This implementation avoids using the Equals(object, object) function in order to avoid the type checking overhead.