//******************************
// Written by Peter Golde
// Copyright (c) 2004-2007, Wintellect
//
// Use and restribution of this code is subject to the license agreement
// contained in the file "License.txt" accompanying this file.
//******************************
using System;
using System.Collections;
using System.Collections.Generic;
namespace Wintellect.PowerCollections
{
///
/// A holder class for various internal utility functions that need to be shared.
///
internal static class Util
{
///
/// Gets the hash code for an object using a comparer. Correctly handles
/// null.
///
/// Item to get hash code for. Can be null.
/// The comparer to use.
/// The hash code for the item.
public static int GetHashCode(T item, IEqualityComparer equalityComparer)
{
if (item == null)
return 0x1786E23C;
else
return equalityComparer.GetHashCode(item);
}
}
}