Skip to content

Instantly share code, notes, and snippets.

@AlexArchive
Created June 23, 2014 18:34
Show Gist options
  • Save AlexArchive/37584814ff98a5b3c0a7 to your computer and use it in GitHub Desktop.
Save AlexArchive/37584814ff98a5b3c0a7 to your computer and use it in GitHub Desktop.
public class MinmalisticHashSet<T>
{
private readonly Dictionary<T, object> _dictionary = new Dictionary<T, object>();
public bool Add(T item)
{
if (_dictionary.ContainsKey(item)) return false;
_dictionary[item] = null;
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment