diff options
author | Andreas Rumpf <ar@kimeta.de> | 2014-04-13 00:32:10 +0200 |
---|---|---|
committer | Andreas Rumpf <ar@kimeta.de> | 2014-04-13 00:32:10 +0200 |
commit | f862e80be96289ad0f54c1d73a3e32734ed48cc3 (patch) | |
tree | ce68b9aaac0d4cf47e514f8758f3bfd8a62b506d /lib | |
parent | 3ee25170c3456640253b1d6ea7ffaaf3de88478f (diff) | |
download | Nim-f862e80be96289ad0f54c1d73a3e32734ed48cc3.tar.gz |
added 'hash' for set[T]'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/hashes.nim | 4 |
1 files changed, 4 insertions, 0 deletions
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 |