diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-04-19 14:42:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 14:42:45 +0200 |
commit | 242d39d27f672a0f3b21f5e8f1752218d1f480f2 (patch) | |
tree | d6579887e27d1aedac4f87c0864ec50a170b05f7 | |
parent | 73eff1f4579c62a083886d78980ecdc805990041 (diff) | |
download | Nim-242d39d27f672a0f3b21f5e8f1752218d1f480f2.tar.gz |
fixes #12834 (#14017)
-rw-r--r-- | lib/pure/hashes.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim index 287b152d2..f7b4e907b 100644 --- a/lib/pure/hashes.nim +++ b/lib/pure/hashes.nim @@ -174,16 +174,16 @@ proc hash*[T: proc](x: T): Hash {.inline.} = else: result = hash(pointer(x)) -proc hashIdentity*[T: Ordinal](x: T): Hash {.inline, since: (1, 3).} = +proc hashIdentity*[T: Ordinal|enum](x: T): Hash {.inline, since: (1, 3).} = ## The identity hash. I.e. ``hashIdentity(x) = x``. cast[Hash](ord(x)) when defined(nimIntHash1): - proc hash*[T: Ordinal](x: T): Hash {.inline.} = + proc hash*[T: Ordinal|enum](x: T): Hash {.inline.} = ## Efficient hashing of integers. cast[Hash](ord(x)) else: - proc hash*[T: Ordinal](x: T): Hash {.inline.} = + proc hash*[T: Ordinal|enum](x: T): Hash {.inline.} = ## Efficient hashing of integers. hashWangYi1(uint64(ord(x))) |