From f862e80be96289ad0f54c1d73a3e32734ed48cc3 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 13 Apr 2014 00:32:10 +0200 Subject: added 'hash' for set[T]' --- lib/pure/hashes.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index ee05ad7e2..5784a96c1 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -129,3 +129,7 @@ proc hash*(x: float): THash {.inline.} = proc hash*[A](x: openArray[A]): THash = for it in items(x): result = result !& hash(it) result = !$result + +proc hash*[A](x: set[A]): THash = + for it in items(x): result = result !& hash(it) + result = !$result -- cgit 1.4.1-2-gfad0