INNER CODE UNIT · C#

Equals

Nonanti/PipeFlow · src/PipeFlow/DataRow.cs:202

    public override bool Equals(object? obj) => obj is DataRow other && Equals(other);

    /// <summary>
    /// Returns a cached, order-independent hash code based on all column names and values.
    /// The cache is invalidated on any mutation.
    /// </summary>
    public override int GetHashCode()
    {
        if (_cachedHashCode is int cached)
            return cached;

        var hash = new HashCode();
        // Order-independent: sort keys by OrdinalIgnoreCase so identical content
        // with different insertion order produces equal hashes.
        foreach (var key in _columnOrder
            .OrderBy(k => k, StringComparer.OrdinalIgnoreCase))
        {
            hash.Add(key, StringComparer.OrdinalIgnoreCase);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…